Filipin.eu

Željko Filipin's blog.
Home Blog Tags License

View on GitHub
27 February 2023

Setting up a new Ubuntu machine

by Željko Filipin

I recently wrote about setting up a new macOS machine. This time I’m setting up a new Ubuntu machine, so I’ve decided to move my private notes to a blog post. Setting up macOS and Ubuntu is surprisingly similar, but there is still enough difference that I have separate notes.

Ubuntu

Update Ubuntu and check Settings. A few tweaks are usually required.

Bitwarden

I use Bitwarden password manager.

sudo snap install bitwarden

Firefox

Ubuntu comes with my favorite browser Firefox already installed. Sign in to Firefox Account. That installs my favorite Firefox additions:

I prefer that browsers download to Desktop instead of Downloads folder.

1Password

Install 1Password password manager that we use at work.

sudo snap install 1password

Git

Install git.

sudo apt install git

SSH

I mostly follow GitHub’s Generating a new SSH key and adding it to the ssh-agent page.

ssh-keygen -t ed25519 -C "computer-name"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-add -l

Upload the public key to Gerrit, GitHub and GitLab.

Dotfiles

I don’t have such a huge investment in my dotfiles repository as some people I know, but I still find that repository very valuable. It makes copying configuration from one machine to another trivial.

mkdir -p ~/Documents/github/zeljkofilipin/
git clone git@github.com:zeljkofilipin/dotfiles.git ~/Documents/github/zeljkofilipin/dotfiles

cp ~/Documents/github/zeljkofilipin/dotfiles/.gitconfig ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.mrconfig.ubuntu ~/.mrconfig
cp ~/Documents/github/zeljkofilipin/dotfiles/.ssh/config.ubuntu ~/.ssh/config

Add Gerrit’s, GitHub’s and GitLab’s fingerprints to the known_hosts file.

cp ~/Documents/github/zeljkofilipin/dotfiles/.ssh/known_hosts ~/.ssh/known_hosts

Docker Engine

MediaWiki-Docker and Fresh (the next two sections) need Docker. I’ve tried Docker Desktop on Linux recently. Unfortunately, MediaWiki-Docker doesn’t work with it. Install Docker Engine instead.

sudo apt update

sudo apt install \
  ca-certificates \
  curl \
  gnupg \
  lsb-release

sudo mkdir -m 0755 -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

DO NOT (!!!) run the last command from the documentation, because it will cause trouble later.

sudo docker run hello-world

Manage Docker as a non-root user

The first command from the documentation is not needed on Ubuntu.

sudo groupadd docker

sudo usermod -aG docker $USER
newgrp docker

Reboot, or Fresh installation will fail.

mr

I use mr to automatically update more than 90 repositories every day. On a clean machine, the tool will clone all repositories.

sudo apt install git myrepos
mr u

Visual Studio Code

Install Visual Studio Code and copy the configuration file from dotfiles.

sudo snap install code --classic
mkdir -p /home/z/.config/Code/User/
cp ~/Documents/github/zeljkofilipin/dotfiles/.config/Code/User/settings.json ~/.config/Code/User/settings.json

Install extensions:

Neovim

Install Neovim and VSCode Neovim extension.

sudo apt install neovim

For more information see Visual Studio Code + Neovim.

MediaWiki-Docker

Install MediaWiki-Docker for the local MediaWiki development environment.

Fresh

Install Fresh for running MediaWiki tests.

Copy the .bashrc file from dotfiles and install the tool.

cp ~/Documents/github/zeljkofilipin/dotfiles/.bashrc ~/.

When the tool is installed, download the container.

fresh-node -env -net

Applications

Install other applications:

ack

sudo apt install ack

Chromium

sudo apt install chromium-browser

ffmpeg

sudo apt install ffmpeg

git-review

sudo apt install git-review

Node.js

sudo apt install nodejs

Ruby

sudo apt install build-essential ruby ruby-bundler ruby-dev

VLC

sudo apt install vlc

Reviewers

I would like to thank Tyler Cipriani for reviewing the article and for advice on how to make it better.

tags: featured - linux