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.
Updating the package list
Section titled “Updating the package list”Before installing anything, update the list of available packages. This tells apt about the latest versions.
$ sudo apt updateThis does not install or upgrade anything. It only refreshes the catalog. Run this before every install session.
Installing packages
Section titled “Installing packages”# 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 fastqcThe -y flag skips the confirmation prompt. This is useful in scripts.
Searching for packages
Section titled “Searching for packages”# Search for a package by name$ apt search samtools
# Show details about a package$ apt show samtoolsThe search and show commands do not require sudo because they only read information.
Upgrading installed packages
Section titled “Upgrading installed packages”# 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 -yRun this regularly to get security patches and bug fixes.
Removing packages
Section titled “Removing packages”# 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 autoremoveCommon packages for bioinformatics
Section titled “Common packages for bioinformatics”Some tools are available directly from Ubuntu repositories.
# 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 treeNot 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.
Adding external repositories
Section titled “Adding external repositories”Some software requires adding a third-party repository first. This is common for newer versions of R, specialized tools, or commercial software.
# 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-packageBe careful with third-party repositories. Only add repositories from sources you trust.
Checking what is installed
Section titled “Checking what is installed”# 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 VersionQuick reference
Section titled “Quick reference”| 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 |
Next steps
Section titled “Next steps”With software installation covered, the next page explains how to connect to remote servers with SSH.