Ubuntu Focal Fossa (20.04) essential starter script
Tags: ubuntu, bash, shell, linux
Published: 2022-12-04 10:56:42

## Introduction

After every new OS reinstallation you have to do the boring part and install everything from scratch. I have been in situation where I was installing
new Ubuntu environment multiple times per year, so I made myself easier and made a bash script which can do this for me.

## What this bash script do

Basically this script is used for installing applications and services, which I normally use, most of the applications and services are for Developers but it can be opted out if you do not 
want something to be installed. In the script there are blocks of installation commands divided by category, so first utilities and prerequired stuff will be installed.
For example if we have some project on github, which is needed to be downloaded like zsh and ohmyzsh, it is prerequired to install git first so if you want to change script have that in mind.

## Applications and services available
As mentioned above, there are different categories so it is easier to organize, in this current version of the script there are 5 categories.
For the some less know application and services I added link so you can read first before installation and check if you want to use it, I personally think that are great stuff but you dont need to use it if you dont want.

### Utility

<SmList>
   <li>curl </li>
   <li>Git </li>
   <li><Link href="https://terminator-gtk3.readthedocs.io/en/latest/">Terminator</Link> </li>
   <li>htop </li>
   <li>unzip </li>
   <li><Link href="https://www.zsh.org/">zsh</Link> </li>
   <li><Link href="https://ohmyz.sh/">OhMyZsh</Link> </li>
</SmList>

### GNome shell and tweaks
<SmList>
   <li>chrome-gnome-shell</li>
   <li>chrome-gnome-tweaks</li>
   <li><Link href="https://albertlauncher.github.io/">Albert</Link> </li>
   <li><Link href="https://github.com/vinceliuice/WhiteSur-gtk-theme">*BigSure OSX theme\**</Link> </li>
</SmList>


### Productivity & Social
<SmList>
   <li>Firefox</li>
   <li><Link href="https://www.taskade.com/spaces/4e4fLuGxvxa7pr1M">Taskade</Link> </li>
   <li><Link href="https://www.cacher.io/">Cacher</Link> </li>
   <li><Link href="https://telegram.org/">*Telegram\**</Link></li>
   <li><Link href="https://discord.com/">*Discord\**</Link></li>
   <li><Link href="https://www.skype.com/en/">*Skype\**</Link></li>
   <li><Link href="https://www.microsoft.com/en/microsoft-teams/log-in">*Microsoft Teams\**</Link></li>
   <li><Link href="https://slack.com/">*Slack\**</Link></li>
   <li><Link href="https://www.rocket.chat/">*Rocket Chat\**</Link></li>
   <li><Link href="https://konversation.kde.org/">*Konversation\**</Link></li>
   <li><Link href="https://www.flock.com/">*Flock Chat\**</Link></li>
</SmList>


### Development

<SmList>
   <li>NodeJS</li>
   <li>npm</li>
   <li>*MongoDB\**</li>
      <li><Link href="https://robomongo.org/">*Robo3T (Robo Mongo)\**</Link> </li>
      <li>*Redis\**</li>
      <li><Link href="https://resp.app/">*Redis Desktop Manager\**</Link> </li>
      <li><Link href="https://www.docker.com/">*Docker\**</Link></li>
   <li><Link href="https://code.visualstudio.com/">Visual Studio Code</Link> </li>
   <li><Link href="https://www.postman.com/">Postman</Link></li>
   <li>TypeScript</li>
   <li>npx</li>
   <li><Link href="https://albertlauncher.github.io/">Sublime Text</Link> </li>
      <li><Link href=" https://www.beekeeperstudio.io/">Beekeper Studio</Link> </li>
</SmList>

### Entertainment
<SmList>
   <li><Link href="https://www.spotify.com/">Spotify</Link></li>
   <li><Link href="https://snapcraft.io/install/orange-app/ubuntu">Orange-app - SoundCloud Client</Link></li>
   <li><Link href="https://www.musixmatch.com/">Musixmatch </Link> </li>
</SmList>

*All applications and services with <Adjusted> * </Adjusted> are optional and can be skipped*

## Script breakdown


As already mentioned, script is sorted by the category and dependency. We can split installation to three types: 
<LgList>
   <li> Straight-forward installation </li>
   <li> Optional installation </li>
   <li> Multi select installation </li>
</LgList>

### Straight-forward installation

Installation of applications and services are pretty straight-forward, most of the installations are from <Adjusted>snap</Adjusted>, some are from <Adjusted>apt</Adjusted> and the rest is from original build source.
It looks something like this:

```bash
sudo snap install curl
sudo apt-get install git -y
```

### Optional installation

In this type use is opted with the prompt to choose wheather to install or not specific application using classic linux options <Adjusted>y/N</Adjusted>

```bash
echo "Do you want to install MongoDB? [Y,n]"
read mongoInput
if [[ $mongoInput == "Y" || $mongoInput == "y" ]]; then
        echo "MongoDB will be installed with Mongo3T ..."
        # Install MongoDB
        echo "${RED}Starting MongoDB installation${NC}"
        wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
        echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
        sudo apt-get update
        sudo apt-get install -y mongodb-org
        sudo snap install robo3t-snap
else
        echo "Skipping MongoDB installation..."
fi
```

### Multi-select installation

Multi-select installation present installation of multi or none applications from the list of proposed applications. This is used for communication and social apps due to everybody is using different app for every day communication or more ofter combination of many social apps so there is option to choose which you want to install.
```bash
names=(telegram-desktop discord skype teams slack rocketchat-desktop konversation flock-chat)
selected=()
PS3='Choose which communication application you want (e.g. 1 2 to install telegram and discord)? : '
select name in "${names[@]}" ; do
    for reply in $REPLY ; do
        selected+=(${names[reply - 1]})
    done
    [[ $selected ]] && break
done
echo Selected: "${selected[@]}"

for t in ${selected[@]}
do
   echo "Installing $t"
   sudo snap install $t
done
```

You can check it out on github https://github.com/basskibo/ubuntu_starter_installer or in the original post on my personal website https://www.bojanjagetic.com/libary/ubuntu-essentials