Skip to content

Installing Software with apt

Ubuntu uses apt to install, update, and remove software. It downloads packages from official repositories and handles all dependencies automatically. Most bioinformatics tools that run on Linux can be installed this way.

Before installing anything, update the list of available packages. This tells apt about the latest versions.

Terminal window
$ sudo apt update

This does not install or upgrade anything. It only refreshes the catalog. Run this before every install session.

Terminal window
# Install a single package
$ sudo apt install samtools
# Install multiple packages at once
$ sudo apt install samtools bcftools bedtools
# Say yes automatically
$ sudo apt install -y fastqc

The -y flag skips the confirmation prompt. This is useful in scripts.

Terminal window
# Search for a package by name
$ apt search samtools
# Show details about a package
$ apt show samtools

The search and show commands do not require sudo because they only read information.

Terminal window
# Upgrade all installed packages to their latest versions
$ sudo apt upgrade
# Update the list and upgrade in one step
$ sudo apt update && sudo apt upgrade -y

Run this regularly to get security patches and bug fixes.

Terminal window
# Remove a package but keep its configuration files
$ sudo apt remove samtools
# Remove a package and its configuration files
$ sudo apt purge samtools
# Clean up packages that were installed as dependencies but are no longer needed
$ sudo apt autoremove

Some tools are available directly from Ubuntu repositories.

Terminal window
# Essential build tools for compiling software
$ sudo apt install build-essential
# Common bioinformatics tools
$ sudo apt install samtools bcftools bedtools
# Python and development headers
$ sudo apt install python3 python3-dev python3-venv
# R base
$ sudo apt install r-base r-base-dev
# Utilities you will use often
$ sudo apt install curl wget git htop tree

Not every bioinformatics tool is in the Ubuntu repositories. For those, you will use other package managers like conda, uv, or install from source. Containers are another option covered in the next section.

Some software requires adding a third-party repository first. This is common for newer versions of R, specialized tools, or commercial software.

Terminal window
# Add a repository
$ sudo add-apt-repository ppa:some/repository
# Update the package list to include the new repository
$ sudo apt update
# Now install the package
$ sudo apt install new-package

Be careful with third-party repositories. Only add repositories from sources you trust.

Terminal window
# List all installed packages
$ apt list --installed
# Check if a specific package is installed
$ apt list --installed | grep samtools
# Check which version is installed
$ apt show samtools | grep Version
Command What it does
sudo apt update Refresh the package catalog
sudo apt install pkg Install a package
sudo apt install -y pkg Install without confirmation
sudo apt upgrade Upgrade all packages
sudo apt remove pkg Remove a package
sudo apt purge pkg Remove a package and its config
sudo apt autoremove Remove unused dependencies
apt search name Search for a package
apt show name Show package details
apt list --installed List installed packages

With software installation covered, the next page explains how to connect to remote servers with SSH.