Managing your software

If you are new to Ubuntu, you may be wondering what to do after installation. After all, Ubuntu is endlessly customizable according to your needs. There are two types of software found in Ubuntu: Debian packages (debs) and snaps – we will focus mainly on debs in this tutorial!

To help you get the most from your Ubuntu experience, this tutorial will walk you through managing the software on your Ubuntu machine. This tutorial can be completed using either Ubuntu Server or Ubuntu Desktop.

If you are re-using a virtual machine from a different tutorial, skip directly to Updating the system with APT.

Set up the virtual machine

To avoid making changes to your computer we will set up a virtual machine (VM), which provides us with a safe environment to run the commands in. Multipass is great for quickly creating Ubuntu virtual machines, so we will use that. It is available on Windows, Mac and Linux, so you don’t need to be already running Ubuntu on your computer to follow this tutorial.

Prerequisites

  • The Multipass VM needs 5 GB of disk space, and 1 GB of memory available.

Install Multipass

You can install Multipass directly from the Multipass page in the online snap store (make sure to select the “latest/stable” version from the dropdown menu next to the install button).

If you’re on Windows, Mac, or another Linux operating system, Multipass can be installed using these instructions.

Open a terminal window

Now that Multipass is installed, we need a terminal window to run our commands in. How you open one depends on your operating system.

Press Ctrl + Alt + T together and a terminal window will open. You can also search for “Terminal” in your application launcher.

PowerShell is the most reliable option for working with Multipass on Windows.

  1. Press the Windows key.

  2. Type PowerShell.

  3. Right-click it and select Run as Administrator — this helps avoid permission issues when managing virtual machines.

If you have Windows Terminal installed from the Microsoft Store, that works just as well and offers a nicer experience with tab support.

To confirm everything is working, type multipass version and press Enter. If you see version numbers, you’re ready to continue.

  1. Press ⌘ + Space to open Spotlight.

  2. Type Terminal and press Enter.

If you use iTerm2, that works perfectly well too.

To confirm everything is working, type multipass version and press Enter. If you see version numbers, you’re ready to continue.

Create the virtual machine

Once you have installed Multipass and opened your terminal, we can launch a new VM using the Ubuntu 26.04 LTS release (codename “resolute”), and let’s give our VM the name tutorial using the following command in our terminal window:

$
multipass launch resolute --name tutorial

It may take a little time, depending on the speed of your internet connection. Multipass downloads the most recent daily image and creates the VM for us.

Note

An Ubuntu image is a collection of files we need to install and run Ubuntu. We don’t need to specify “server” or “desktop” anywhere in our command, because the image is the same for both. The only difference between Ubuntu Server and Ubuntu Desktop is the subset of software packages we use from the Ubuntu Archive.

Once the above command has finished running, we can access the VM by running:

$
multipass shell tutorial

We will get a “Welcome to Ubuntu” message. Notice that when we run this command, the terminal username changes to ubuntu and the hostname changes to tutorial:

ubuntu@tutorial:~ $

This shows that we are inside the VM, and this is where we will run all our commands. Now that our setup is complete, let’s carry on with the tutorial!

Updating the system with APT

The first thing we always want to do with a new system (whether a VM, container, bare metal, or cloud instance) is to make sure we have the latest versions of all the pre-installed software.

Debian packages, commonly referred to as debs, are the standard software package format in Ubuntu. They can be identified by the .deb file extension.

Every Linux distribution has their own preferred package manager for installing, updating and removing packages. In Ubuntu, the default package manager is Advanced Packaging Tool (or APT, for short).

APT handles all of your system software (and other deb packages). It provides an interface to the Ubuntu Archive repository, so it can access both the database of all the packages available in Ubuntu, and the means to handle the packages themselves.

There are two APT commands we need to update our system: update and upgrade, which we will always run in that order.

apt update

The apt update command is about the database. Any bug fixes in a package (or new versions since your last update) will be stored in the metadata about that package in the database (the package index).

When we run the update command it updates the APT database on our machine, fetching the newest available metadata from the package index:

$
sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu resolute InRelease
Hit:2 http://archive.ubuntu.com/ubuntu resolute-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu resolute-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu resolute-security InRelease
19 packages can be upgraded. Run 'apt list --upgradable' to see them.

As we can see, it checks (“hits”) the various archives (pockets) that updates can come from for the 26.04 LTS release (resolute, resolute-updates, resolute-backports, and resolute-security – remember these, as we’ll come back to them later). It has found some packages that can be upgraded to newer versions. If we want to see which packages those are, we can run the command hinted in the output:

$
apt list --upgradable

The specific packages included in this list change over time, so the exact packages shown will be different, but the output will be structured like this:

bind9-dnsutils/resolute-updates,resolute-security 1:9.20.18-1ubuntu2.1 amd64 [upgradable from: 1:9.20.18-1ubuntu2]
bind9-host/resolute-updates,resolute-security 1:9.20.18-1ubuntu2.1 amd64 [upgradable from: 1:9.20.18-1ubuntu2]
bind9-libs/resolute-updates,resolute-security 1:9.20.18-1ubuntu2.1 amd64 [upgradable from: 1:9.20.18-1ubuntu2]
bpftool/resolute-updates 7.7.0+7.0.0-22.22 amd64 [upgradable from: 7.7.0+7.0.0-15.15]
libgcrypt20/resolute-updates,resolute-security 1.12.0-2ubuntu0.1 amd64 [upgradable from: 1.12.0-2]
[...]

The output tells us:

  • the package name and where the update will come from (e.g. bind9-dnsutils package from resolute-updates and resolute-security),

  • the most up-to-date package version available (e.g. 1:9.20.18-1ubuntu2.1),

  • the hardware version the update is for (e.g. amd64), and

  • what package version is currently installed (e.g. 1:9.20.18-1ubuntu2)

apt upgrade

The apt upgrade command is about the packages on your system. It looks at the metadata in the package index we just updated, finds the packages with available upgrades, and lists them for us. Once we’ve checked the proposed upgrade and are happy to proceed, it will then install the newer versions for us.

After we have updated the database (which we did by running apt update) we can then upgrade the packages to their newest versions by running:

$
sudo apt upgrade

When we run this command, it will ask us to confirm if the summary of proposed changes that will be made to our system is what we want.

Let’s type Y, then press Enter to confirm that yes, we do want that, and then the upgrade will proceed. This may take a few minutes.

Tip

You can use the -y flag, which is a shorthand for --assume-yes. If we ran the command sudo apt upgrade -y it would proceed with the upgrade without asking us to confirm. Shorthand versions of flags are common – for most packages, you can check which flags are equivalent using the manual pages or using the man command, as we’ll see later.

In the output, we’ll see where apt upgrade is fetching the upgrade from for each package. For example:

Get:1 http://archive.ubuntu.com/ubuntu resolute-updates/main amd64 libgcrypt20 amd64 1.12.0-2ubuntu0.1 [670 kB]

APT combines the various elements; the package name (libgcrypt20), version (1.12.0-2ubuntu0.1), source (resolute-updates/main), etc into a single URL that it can use for the download. The package is then unpacked, and the upgrade applied to the system.

Note

These commands only upgrade the packages for the release of Ubuntu that we are using (26.04 LTS). If we wanted to upgrade the entire system to the next release of Ubuntu (e.g. from 22.04 LTS to 24.04 LTS), we would use the do-release-upgrade command. See this guide on how to upgrade your release for more information.

It’s important to know that apt upgrade will only handle packages that can be straightforwardly upgraded. If the package has dependency issues (i.e., the version you have “depends” on other packages that also need to be added, upgraded or removed), you would need to use sudo apt dist-upgrade instead. The dist-upgrade command is able to resolve conflicts between package versions, but it could end up removing some packages. So while apt upgrade is safe to use unattended (in a script, for example), you should only use dist-upgrade when you can review which packages may be removed.

Searching with APT

Now we’re up-to-date, we can start exploring! As with any other database, we can search the list of available packages using APT in order to find software. Let’s say that we want to find a web server, for example. We can run the following command:

$
apt search webserver

This will return us a long list of all “webserver” packages it can find. But some of the descriptions don’t actually contain the text “webserver” – like in this section of the list:

inotify-tools/resolute 4.25.9.0-1 amd64
  command-line programs providing a simple interface to inotify

ipcalc/resolute 0.51-1build1 all
  parameter calculator for IPv4 addresses

iwatch/resolute 0.2.2-12 all
  realtime filesystem monitoring program using inotify

We can use apt show to inspect the description and summary details of any package, so let’s take a closer look at ipcalc from our list:

$
apt show ipcalc

The summary has been replaced with [...] for brevity, but we can see that the text “webserver” is in the long description of the “Description” field.

Package: ipcalc
Version: 0.51-1build1
[...]
APT-Sources: http://archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
Description: parameter calculator for IPv4 addresses
 ipcalc takes an IPv4 address and netmask and calculates the resulting
 broadcast, network, Cisco wildcard mask, and host range. By giving a
 second netmask, you can design sub- and supernetworks. It is also
 intended to be a teaching tool and presents the results as
 easy-to-understand binary values.
 .
 Originally, ipcalc was intended for use from the shell prompt, but a
 CGI wrapper is provided to enable colorful HTML display through a
 webserver.

While we used apt in the apt show command, in many places you will see reference to apt-get and apt-cache instead of apt. Historically, the database part of APT was accessed using apt-cache (e.g. apt-cache show ipcalc), and the packages part of APT used apt-get (e.g. apt-get install ipcalc).

APT has recently been streamlined, so although it uses apt-get and apt-cache “behind the scenes” (and these commands do still work), we don’t need to worry about remembering which command to use – we can use the more convenient apt directly. To find out more about these packages and how to use them (or indeed, an