Ubuntu 21.10 installation with a bunch of programs
Tags: ubuntu, linux, tutorial, productivity
Published: 2022-04-22 22:40:13

Hi, guys. How are you?

In this post I'll share the script I've been writing down during my most recent installation of Ubuntu 21.10, so I can reuse it on another computer.

It's divided into the following sections:

- [Initial tasks](#initial-tasks)
- [Install essential software](#install-essential-software)
- [Tasks to do after install](#tasks-to-do-after-install)
- [Development](#development)
- [Browsers](#browsers)
- [Other softwares](#other-softwares)

> **Note**: This script is constantly changing. Follow the [Ubuntu 21.10 Installation](https://gist.github.com/thiagobraga/7332f71ac029c2babbee5cce20594ffb) gist for the most current version, in case the text below is out of date.

<br>
  

## Initial tasks

### Use `sudo` without password

```sh
# TODO: Check if entry already exists in sudoers file
```

```sh
# It'll ask for password only once
echo "${USER} ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers
```

### Update installed programs

```sh
sudo apt update
sudo apt upgrade -yV
sudo apt autoremove -yV
sudo apt autoclean
```

### Make Ubuntu use local time for hardware clock

It avoids conflicts with Windows clock in dual-boot setups.

```sh
timedatectl set-local-rtc 1
```

<br>

## Install essential software

```sh
sudo apt install -y \
  apt-transport-https \
  bash \
  bat \
  chrome-gnome-shell \
  clang \
  cmake \
  curl \
  dconf-editor \
  dosfstools \
  findutils \
  gawk \
  git \
  gnome-shell-extension-prefs \
  gnome-tweaks \
  gpick \
  grep \
  grub-common \
  grub-pc-bin \
  htop \
  jq \
  libcurl4-openssl-dev \
  libffi-dev \
  libpython3-dev \
  libreadline-dev \
  libssl-dev \
  libtool-bin \
  libwim15 \
  libwxbase3.0-0v5 \
  libwxgtk3.0-gtk3-0v5 \
  libxslt1-dev \
  libxt-dev \
  libyaml-dev \
  make \
  ntfs-3g \
  p7zip \
  p7zip-full \
  parted \
  python3-wxgtk4.0 \
  qt5ct \
  samba \
  tmux \
  ubuntu-restricted-extras \
  unrar \
  util-linux \
  vim \
  wget \
  wimtools \
  xclip \
  zlib1g-dev \
  zsh
```

<br>

## Tasks to do after install

### Make `zsh` default shell to user and root

```sh
sudo chsh -s $(which zsh) ${USER}
sudo chsh -s $(which zsh) root
```

### Add samba user

```sh
sudo smbpasswd -a ${USER}
```

<br>

## Development

<br>

### PHP

#### PHP 7.4

```sh
sudo add-apt-repository -y ppa:ondrej/php
sudo sed -i 's/impish/focal/' /etc/apt/sources.list.d/ondrej-ubuntu-php-impish.list
sudo apt update
sudo apt install -y php7.4-{cli,curl,fpm,mcrypt,xdebug,xml,zip}
```

#### Composer

```sh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer                            
```

#### PHP CodeSniffer (phpcs)

```sh
composer global require squizlabs/php_codesniffer=3.6.0
```

<br>

### Python

#### Python 3

```sh
sudo apt install -y python-is-python3 python3-pip
```

<br>

### Ruby

#### Ruby 2.7.1

```sh
sudo apt install -y rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
rbenv install 2.7.1
rbenv global 2.7.1
```

#### Gollum (Gitlab Wiki)

```sh
gem install gollum
```

<br>

### IDE

#### Sublime Text

```sh
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update
sudo apt install -y sublime-text
```

#### VS Code

```sh
sudo apt install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install -y code
```

<br>

### DBMS

#### DBeaver

```sh
sudo add-apt-repository -y ppa:serge-rider/dbeaver-ce
sudo apt install -y dbeaver-ce
```

#### MySQL Workbench

```sh
sudo apt install -y mysql-workbench
```

<br>

### DevOps tools

#### Docker

```sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
rm -f get-docker.sh
```

#### Docker Compose

> I'm still using v1.29.2 because of incompatibilities with BuildKit in some projects I work.

```sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
```

#### Ansible

```sh
sudo apt install -y ansible
```

#### Terraform

```sh
sudo apt install -y terraform
```

#### Kool

```sh
curl -fsSL https://kool.dev/install | BIN_PATH=~/.local/bin/kool bash
```

#### Heroku

```sh
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
```

#### Minikube

```sh
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
```

<br>

### RestAPIs

#### Postman

```sh
curl -Lo postman-linux-x64.tar.gz https://dl.pstmn.io/download/latest/linux64
tar zxvf postman-linux-x64.tar.gz
rm -f postman-linux-x64.tar.gz
sudo mv Postman /opt
sudo ln -sf /opt/Postman/Postman /usr/local/bin/postman
sudo ln -sf /opt/Postman/Postman /usr/bin/postman
```

<br>

## Browsers

### Brave

```sh
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave.list
sudo apt update
sudo apt install -y brave-browser
```

### Chrome

```sh
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm -f google-chrome-stable_current_amd64.deb
```

### Firefox

```sh
sudo snap remove firefox --purge
sudo apt install -y firefox
```

### Microsoft Edge Dev

```sh
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
sudo rm -f microsoft.gpg
sudo apt update
sudo apt install -y microsoft-edge-dev
```

<br>

## Other softwares

### Balena Etcher

```sh
curl -1sLf 'https://dl.cloudsmith.io/public/balena/etcher/setup.deb.sh' | sudo -E bash
sudo apt update
sudo apt install -y balena-etcher-electron
```

### Clementine

```sh
sudo apt install -y clementine
```

### Flatpak

```sh
sudo apt install -y \
  gnome-software \
  gnome-software-plugin-flatpak \
  flatpak
```

### Gparted

```sh
sudo apt install -y gparted
```

### Grub Customizer

```sh
sudo apt install -y grub-customizer
```

### Nemo

```sh
sudo apt install -y nemo
```

### Numlockx

```sh
sudo apt install -y numlockx
```

### Peek

```sh
sudo add-apt-repository -y ppa:peek-developers/stable
sudo apt install -y peek
```

### qBitTorrent

```sh
sudo add-apt-repository -y ppa:qbittorrent-team/qbittorrent-stable
sudo apt install -y qbittorrent
```

### Remmina

```sh
sudo apt-add-repository -y ppa:remmina-ppa-team/remmina-next
sudo apt install -y remmina remmina-plugin-rdp remmina-plugin-secret
```

### SmartGit

```sh
# TODO: It is incomplete. Sorry :)
tar xzf <smartgit*.tar.gz>
bin/add-menuitem.sh
```

### Spotify

```sh
curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add - 
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update && sudo apt install -y spotify-client
```

### Steam

```sh
curl -0L https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb -o ~/Downloads/steam.deb
sudo dpkg -i ~/Downloads/steam.deb
rm -f ~/Downloads/steam.deb
```

### Terminator

```sh
sudo apt install -y terminator
```

### TestDisk

```sh
sudo apt install -y testdisk
```

### Tux Guitar

```sh
sudo apt install -y tuxguitar \
  tuxguitar-jsa \
  fluid-soundfont-gm \
  fluid-soundfont-gs \
  fluidsynth \
  timidity
```

### Typora

```sh
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
sudo add-apt-repository -y 'deb https://typora.io/linux ./'
sudo apt install -y typora
```

### WoeUSB

```sh
sudo add-apt-repository -y ppa:tomtomtom/woeusb
sudo apt install -y woeusb-frontend-wxgtk
```

### Zoom

```sh
wget https://zoom.us/client/latest/zoom_amd64.deb -O zoom.deb
sudo apt install -y ./zoom.deb
rm -f zoom.deb
```