Prepare a fresh linux installation

Steps needed to prepare a Linux system when it was completely wiped out or is new. (most) commands are ready to copy and paste.

Prepare System

Automatic installations

sudo apt install snapd htop &&
sudo snap install postman rambox vlc postman spotify tor google-cloud-sdk &&
sudo snap gitkraken install intellij-idea-community pycharm-community --classic

Copy aliases

Copy the following file into ~ (add link to my aliases file)
Set it so it auomatically loads on startup. Add the following line at ~/.bashrc or ~/.zshrc

source ~/zsh_aliases

Folders to create

mkdir ~/Documentos/personal ~/Documentos/projects ~/programs ~/tmp
ln -s ~/Documentos/projects ~/projects &&
ln -s ~/Documentos/personal ~/personal

Programs to install manually

Download, extract and move into ~/programs

Scripted installations

sudo apt-get install vim chromium-browser openjdk-11-jdk maven

For maven copy your settings.xml into ~/.m2 if necessary.

Shell (Terminator + Oh my ZSH)

Oh my ZSH

# Prerequisites + Terminator
sudo apt-get install zsh fonts-powerline dconf-cli terminator

log-out, close session and log-in again to refresh the shell.

Install Oh my ZSH

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Change and configure Theme

Modify file ~/.zshrc and change the variable ZSH_THEME="robbyrussell" for ="agnoster"

git clone git://github.com/sigurdga/gnome-terminal-colors-solarized.git ~/.solarized &&
cd ~/.solarized &&
./install.sh

After installation, edit ~/.zshrc again and add the following line

eval `dircolors ~/.dir_colors/dircolors`

Open terminator, right click on the shell > Einstellungen > Profile > Farben

  1. Vorder- und Hintergrund > Integrierte Schemata > dunkel Solarisiert
  2. Farbpalette > Integrierte Schemata > Gruvbox dunkel

Plugins

Install zsh-autosuggestions

We only need the zsh-autosuggestions.zsh script.

cd ~/.oh-my-zsh/custom &&
git clone https://github.com/zsh-users/zsh-autosuggestions.git &&
cp zsh-autosuggestions/zsh-autosuggestions.zsh .. &&
gio trash zsh-autosuggestions/

Reference(s)

https://github.com/robbyrussell/oh-my-zsh
https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
https://gist.github.com/renshuki/3cf3de6e7f00fa7e744a
https://github.com/zsh-users/zsh-autosuggestions https://github.com/denisidoro/navi?utm_campaign=explore-email&utm_medium=email&utm_source=newsletter&utm_term=weekly#installation
https://github.com/junegunn/fzf#using-git

Docker

# Prerequisites
sudo apt-get update

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

# installation
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
sudo docker run hello-world # verify

sudo groupadd docker
sudo gpasswd -a {$USER} docker

Log out and in again so that you’re able to use docker without sudo

Reference(s)

https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository
https://linuxhint.com/install_docker_linux_mint/

MongoDB

Create the directories /data/db

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 68818C72E52529D4
sudo echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install mongodb-org

To start the service sudo mongod &

Problems

Sometimes it’s tricky to get it right at the first installation. If you’re getting a conflict like the following:

Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Probieren Sie »apt --fix-broken install«, um dies zu korrigieren.
Die folgenden Pakete haben unerfüllte Abhängigkeiten:
 mongodb-org : Hängt ab von: mongodb-org-server soll aber nicht installiert werden
               Hängt ab von: mongodb-org-mongos soll aber nicht installiert werden
               Hängt ab von: mongodb-org-tools soll aber nicht installiert werden
E: Unerfüllte Abhängigkeiten. Versuchen Sie »apt --fix-broken install« ohne Angabe eines Pakets (oder geben Sie eine Lösung an).

and sudo apt --fix-broken install does nothing. Try to remove all the conflicting packages and install them again.

sudo apt-get purge x # do for all installed mongo packages
sudo apt-get autoremove
sudo apt-get install -f

Reference(s)

https://www.howtoforge.com/tutorial/install-mongodb-on-ubuntu/

MySQL

Use it through Docker. We use a specific MySQL version and I couldn’t install it in local.

Create desktop entries

This is to be able to start them through menu key. They’re saved at ~/.local/share/applications

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=IntelliJ
Path=/home/msanchez/Programs/intellij
Exec=/home/msanchez/Programs/intellij/bin/idea.sh
Icon=/home/msanchez/Programs/intellij/bin/idea.png

Additional Steps

  • Clone git repositories into ~/Dokumente/projects
  • Import them into Gitkraken
  • Set username, password and initialize git flow