Note: This article was updated on 2023-09-03 to reflect changes to the way GPG keys should be installed for some software (such as Docker).

Ok, so who is this for? Link to heading

This blog post is for myself, mostly. It’s nice to have a friendly, internet-accessible list of all the commands I usually run to set up a fresh Ubuntu box. Use these at your own risk!

For some items (NVIDIA docker stuff, Signal messenger), my instructions are lifted right off of the install pages for those tools. It’s usually a good idea to go and have a look at those pages yourself. They’re likely to be more up to date than whatever I have written here.

Ok, enough caveats…on to the list!

Stuff to install the normal way (with apt) Link to heading

First, run an update and upgrade anything that needs upgrading:

sudo apt-get update
sudo apt-get upgrade

Then, clean up a bit:

sudo apt-get autoclean
sudo apt-get autoremove

Often I reboot after these first couple of steps. Just to keep a fresh, clean environment (and also in case there were kernel updates).

Ubuntu comes with nano as the default text-editor, but I prefer vim:

sudo apt-get -y install vim

Install VirtualBox and supporting software so we can set up VMs more easily:

sudo apt-get -y install virtualbox virtualbox-ext-pack

Perform some additional setup so that VirtualBox permissions will work properly:

sudo usermod -G vboxusers -a $USER

Install prerequisites for fetching Docker:

sudo apt-get install ca-certificates curl gnupg

Install the GPG key for the Docker repo:

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Set up the Docker repo:

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

Now, install Docker itself:

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

You may need to add your user to the docker group in order to run docker without sudo:

sudo groupadd -f docker
sudo usermod -aG docker $USER

You may need to close and reopen your terminal (or log out and back in) to get the changes to take effect. Run newgrp docker from the current terminal if you want to test things right away without doing this.

SSH and network utilities (I’m old-fashioned and used to using ifconfig, hence I install net-tools):

sudo apt-get -y install net-tools
sudo apt-get -y install openssh-server
sudo systemctl enable ssh.service

Some other handy utilities:

sudo apt-get -y install keepassxc
sudo apt-get -y install awscli
sudo apt-get -y install jq
sudo apt-get -y install screen
sudo apt-get -y install tree

Install packages for 2D and 3D art:

sudo apt-get -y install inkscape gimp blender

Install video editing and compression tools:

sudo apt-get -y install vlc handbrake shotcut

Install all of texlive (for preparing LaTeX documents):

sudo apt-get -y install texlive-full

Install pwgen and gh (GitHub CLI):

sudo apt-get install -y gnupg software-properties-common pwgen gh

Install Java and associated utils:

sudo apt-get -y install default-jre default-jdk

Install screen annotation software (super handy for meetings and the like):

sudo apt-get -y install gromit-mpx

gparted, for partitioning and formatting disks:

sudo apt-get -y install gparted

I need the ability to write Chinese as well, so I need ibus pinyin support:

sudo apt-get -y install ibus-pinyin

I also use Terraform and Packer for cloud infrastructure management:

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common

Fetch the GPG key for the Terraform repository:

wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg

Add the repository:

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list

Update apt:

sudo apt update

Install Terraform and Packer:

sudo apt-get install -y terraform packer

Install Signal (encrypted messaging). First, wen eed to fetch and install the GPG key

wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null

Next, add the repository:

echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
  sudo tee /etc/apt/sources.list.d/signal-xenial.list

Finally, update and install:

sudo apt update && sudo apt install signal-desktop

Python Packages Link to heading

Anaconda Link to heading

Install prerequisites for the Anaconda GUI stuff:

apt-get install -y libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

Download the package from here, then install with:

bash Anaconda3-*-Linux-x86_64.sh

The Anaconda installer likes to run inside an independent bash session, so you should run the command as it is shown above, even if your system shell is already bash.

Handy PIP packages (Python 3):

pip install boto3 sshuttle

Snap Packages Link to heading

Install telegram for for messaging:

sudo snap install telegram-desktop

Everything Else Link to heading

I also install some commercial packages, which should be fetched directly from the respective official sources, and installed directly from .deb files like so.

Visual Studio Code:

sudo apt install ./code*.deb

Discord:

sudo apt install ./discord*.deb

Google Chrome:

sudo apt install ./google-chrome*.deb

Minecraft:

sudo apt install ./Minecraft*.deb

TeamViewer (for remote access to phones and computers):

sudo apt install ./teamviewer*.deb

Zoom (for online meetings):

sudo apt install ./zoom*.deb

NVIDIA tools (for machines with one or more NVIDIA GPUs) Link to heading

When I have a GPU available, I follow these instructions to add container toolkit support.

I don’t reproduce the instructions here because they are fairly long.