Beginner · 6 min · practise every command in the built-in terminal

apt — Debian/Ubuntu Package Manager

apt (Advanced Package Tool) is how you install, update, and remove software on Debian-based systems (Ubuntu, Debian, and this playground's own container).

Update the package index

sudo apt update

This refreshes the local list of available packages and their versions from the configured repositories. It does not install anything — think of it as "check what's new".

See what can be upgraded

apt list --upgradable

Upgrade installed packages

sudo apt upgrade         # Upgrade everything that's safe to upgrade
sudo apt full-upgrade    # Also handles dependency changes (may remove packages)

Why update before upgrade?

update refreshes the catalog; upgrade installs newer versions from that catalog. Running upgrade without a recent update means you might be working from a stale list.

Checking apt's version and config

apt --version
cat /etc/apt/sources.list        # Where packages come from

Practice tasks

  1. Refresh the package index with apt
  2. List packages that have available upgrades
  3. Upgrade all installed packages
  4. Check the installed version of apt itself

Commands in this lesson

Package Management