A Beginner’s Guide to the APT Package Manager
Installing software on Ubuntu does not usually mean searching the web, downloading an installer and clicking through several setup screens. In most cases, the safer and easier route is to use APT, the package management system that connects your computer to Ubuntu’s software repositories.
APT handles software packages, dependencies, updates and removal. It can install a media player, development tool, printer driver or desktop utility while also fetching the libraries that program needs to work. This saves time and reduces the chance of downloading an unsafe or incompatible file.
The commands may look unfamiliar at first, particularly if you are more comfortable with graphical tools such as App Center or Synaptic. APT is still worth learning because it is quick, transparent and available on almost every Ubuntu installation. It also provides useful repair options when a graphical software tool gets stuck.
The examples below use commands in the Terminal and apply to current Ubuntu desktop releases. The same package manager is used on Ubuntu flavours such as Kubuntu and Xubuntu, as well as many Debian-based distributions. If you are using Ubuntu over a mobile hotspot in regional New South Wales or Western Australia, APT can also help you control exactly when large downloads occur.
What APT Does
APT stands for Advanced Package Tool. It works with .deb software packages, which are the standard package format used by Ubuntu and Debian. Rather than treating each application as an isolated download, APT keeps track of the application, its required libraries and other supporting components.
A package manager also records what is installed on your system. When you ask for an application, APT checks the available software repositories, compares package versions and resolves dependencies. A dependency might be a shared library, a command-line utility or a language component required by the application.
The apt command is the modern, user-friendly interface. Older guides often use apt-get, which remains useful in scripts and automated systems. For everyday terminal work, commands such as sudo apt update, sudo apt install and sudo apt upgrade are easier to read and provide more helpful progress information.
Preparing Ubuntu For Package Work
Before installing anything, refresh the local list of packages with:
sudo apt update
This command does not upgrade applications. It contacts the configured repositories and downloads current information about available package names, versions and security updates. sudo gives APT the administrator permission it needs, so Ubuntu will ask for your account password. Nothing appears on screen while you type the password; that is normal.
Run this command before installing a package if you have not updated the lists recently. A home broadband connection on the NBN will usually complete the process quickly, while a mobile connection may use a noticeable amount of data. If you are in a remote area with limited data, run updates while connected to a reliable Wi-Fi network rather than relying on a phone hotspot.
Once the package information is current, upgrade installed packages with:
sudo apt upgrade
APT displays the packages it plans to change and asks you to confirm. Review the summary before entering Y. A standard upgrade normally keeps your existing Ubuntu release and updates applications, libraries and security fixes within that release. It is different from a full release upgrade, such as moving from Ubuntu 24.04 LTS to a later version.
Finding Software In The Repositories
You can search the repository catalogue without installing anything:
apt search image editor
Search terms are matched against package names and descriptions, so a broad search can produce many results. For a closer look at one package, use:
apt show gimp
The output includes the package description, installed and available versions, download size, installed size and dependencies. This is useful when several packages have similar names. For example, a package may provide a graphical application while another with a similar name supplies command-line tools or development files.
Package names are often shorter and less obvious than application names. The Firefox web browser is packaged as firefox, while the VLC media player uses vlc, the LibreOffice suite uses libreoffice, and the GIMP image editor uses gimp. Ubuntu’s App Center can help you discover software visually, then apt show can provide extra technical detail.
Repositories do not contain every application available for Linux. Some developers distribute software as a Snap, Flatpak, AppImage or vendor-provided .deb file. APT is the right choice for packages in Ubuntu’s configured repositories, but installing an unrelated repository or download source should be treated carefully.
Installing And Updating Applications
Install a package with:
sudo apt install vlc
APT shows the package it will install, any additional dependencies and the amount of disk space required. Type Y to continue. After the process finishes, you can launch the application from the desktop application menu. Many command-line programs can be started directly by entering their package or executable name in the Terminal.
Several packages can be installed in one command:
sudo apt install git curl build-essential
This is useful after setting up a new machine, although you should install only software you recognise and need. APT checks package signatures and retrieves files from trusted repositories, which is safer than copying random commands from an unfamiliar forum post.
To install a particular version, first inspect the available versions:
apt policy firefox
You can then specify a version if that package is available:
sudo apt install firefox=package-version
The exact version string varies, so copy it carefully from the apt policy output. Most desktop users should allow Ubuntu to select the normal candidate version rather than forcing an older release.
Regular maintenance usually consists of running sudo apt update followed by sudo apt upgrade. Ubuntu’s graphical updater may perform the same job. Security updates are especially important for internet-facing devices, including laptops used on public Wi-Fi at a Melbourne library, Brisbane café or university campus.
Removing Packages And Cleaning Space
When you no longer need a package, remove it with:
sudo apt remove vlc
This uninstalls the application while generally leaving its system-wide configuration files. If you want to remove the package and those configuration files, use:
sudo apt purge vlc
Purging does not necessarily remove personal settings stored in your home folder. Applications often keep user configuration under hidden directories such as ~/.config, so those files may need separate removal if you want a completely fresh reset. Avoid deleting hidden folders unless you know what they contain.
APT may install dependencies that are no longer needed after an application has been removed. You can review these packages with:
sudo apt autoremove
Read the proposed removal list before confirming. Usually these are orphaned libraries, but a package you still use may have been marked as no longer required in an unusual setup. If an important application appears in the list, cancel the operation and investigate before proceeding.
Downloaded package files are stored in APT’s cache. To clear packages that are no longer needed, use:
sudo apt clean
This can recover disk space, which is useful on small laptops, older computers and Raspberry Pi systems. It removes cached package files, not installed applications.
Understanding Repositories And Trust
Ubuntu receives software from repositories defined in its APT configuration. The main Ubuntu repositories include packages supported by Ubuntu, community-maintained packages and additional software components. Exact repository names depend on your Ubuntu release and enabled settings.
You can inspect the repository configuration with:
grep -R ^deb /etc/apt/sources.list /etc/apt/sources.list.d/
Some newer Ubuntu releases store repository definitions in files ending in .sources, so you may also see configuration under /etc/apt/sources.list.d/. Most users do not need to edit these files manually. The Software & Updates tool provides a graphical way to enable or disable common repository components.
Ubuntu downloads may come from a nearby mirror. Australian users can sometimes see an Australian mirror such as au.archive.ubuntu.com, while other systems use a global address that redirects to an appropriate server. Mirror location can affect speed, particularly for users on slower regional connections, but reliability matters more than choosing a specific country.
Third-party repositories, often called PPAs, can provide newer applications or versions unavailable in the standard Ubuntu archive. They also become another source of updates and must be maintained across Ubuntu release changes. Add a PPA only when it comes from a developer or project you trust, and remove it if it is no longer maintained.
Never paste a command containing curl, wget, sudo or a remote installation script into the Terminal without understanding it. APT’s repository signatures help verify packages from configured sources, but they do not make every third-party repository trustworthy.
Fixing Common APT Problems
If APT reports that it was interrupted, finish the pending package configuration with:
sudo dpkg --configure -a
Then repair missing dependencies with:
sudo apt --fix-broken install
Run these commands one at a time and read the output. The dpkg tool works underneath APT and sometimes needs to complete configuration before APT can continue. Restarting the computer is not usually the first repair step.
A “package not found” message often means the package name is wrong, the relevant repository is disabled or the package is not available for your Ubuntu release. Run sudo apt update, check the spelling with apt search, and confirm that the software supports your version of Ubuntu.
A lock error may appear if another package tool is already running. The graphical updater, App Center or an automatic background update could be using APT. Close the other tool and wait briefly. Do not delete lock files while a package operation is active, because that can damage the package database.
For more detail about an operation, use:
apt list --upgradable
apt policy package-name
The first command lists installed packages with newer versions available. The second shows the installed version, repository candidate and available sources. These commands are safe because they only display information.
Building Good Package Habits
APT is powerful, but simple habits make it safer. Refresh package information before a major installation, check what will be removed, and keep enough free disk space for downloaded packages and temporary files. On a laptop used between Sydney and Canberra, postponing a large upgrade until you have dependable Wi-Fi can prevent an interrupted download.
Use the standard Ubuntu repositories where possible, and keep third-party sources to a minimum. A package from an official repository may be older than the latest upstream release, but it has been built and tested for the Ubuntu ecosystem. If you need a newer version, compare the project’s official instructions with Ubuntu’s available package before choosing a different distribution method.
It is also worth learning the difference between updating package information and upgrading software. apt update refreshes the catalogue; apt upgrade installs available updates. Running only the first command does not update applications, while running only the second may use outdated package information.
APT records its work in system logs, which can help when diagnosing a failed installation. Experienced users can inspect /var/log/apt/history.log and /var/log/dpkg.log, but beginners can usually start with the error message shown in the Terminal. Copying the exact package name and error text into Ubuntu documentation or a trusted support forum is more useful than describing the problem vaguely.
A practical routine is to run sudo apt update, review the result, then use sudo apt upgrade when convenient. Install new software with sudo apt install package-name, remove it with sudo apt remove package-name, and use sudo apt autoremove only after checking the proposed list. These few commands cover most everyday package management tasks while keeping an Ubuntu system tidy, current and easier to troubleshoot.