apt
Manage software packages (install, update, remove)
TLDR
Update the list of available packages and versions (recommended before running other apt commands)
Search packages by name or description
Search packages by name only (supports wildcards like *)
Show detailed information about a package
Install a package, or update it to the latest version
Remove a package (use purge instead to also remove configuration files)
Upgrade all installed packages to their latest versions
List all installed packages
SYNOPSIS
apt [options] command
Common commands:
apt install package...
apt remove package...
apt update
apt upgrade
apt full-upgrade
apt search keyword
apt show package
apt list [options]
apt autoremove
apt clean
PARAMETERS
--assume-yes, -y
Automatically answer yes to prompts; proceed without asking for confirmation.
--simulate, -s, --just-print, --dry-run
Perform a dry run; show what would happen without actually making any changes.
--fix-broken
Attempt to correct a system where broken dependencies prevent package operations.
--no-install-recommends
Do not install recommended packages as dependencies. Only essential and suggested ones.
--allow-downgrades
Permit the installation of older versions of packages (use with caution).
--allow-remove-essential
Allow removal of essential system packages (highly dangerous; use only if you know what you're doing).
--allow-change-held-packages
Allow changes to packages that have been 'held' (marked to prevent upgrades).
--help, -h
Display a brief help message and exit.
--version, -v
Display the version information and exit.
DESCRIPTION
apt is the command-line utility for the Advanced Package Tool (APT) system, primarily used on Debian-based Linux distributions like Ubuntu, Mint, and Pop!_OS. It provides a high-level, user-friendly interface for managing software packages. apt simplifies tasks such as installing, upgrading, removing, and searching for software, handling complex dependencies automatically. While older commands like apt-get and apt-cache still exist and are used in scripts, apt offers a more interactive and visually appealing experience for human users, featuring progress bars, colored output, and a more concise syntax. It intelligently resolves dependencies, ensuring that all necessary libraries and components are installed when you add new software and safely removed when no longer needed. This makes apt an indispensable tool for system administration and software management on Debian-derived systems.
CAVEATS
apt operations typically require root privileges (e.g., using sudo).
Incorrect usage, especially forcing installations or removals without understanding consequences, can lead to system instability or breakage.
It manages .deb packages and repositories configured in /etc/apt/sources.list and /etc/apt/sources.list.d/. It does not directly manage snap or flatpak packages, which have their own dedicated package managers.
Dependency resolution, while powerful, can sometimes lead to complex scenarios known as "dependency hell" if repositories are misconfigured or external packages are introduced carelessly.
UNIFIED INTERFACE
apt was designed to be a unified front-end, combining the most frequently used functions of apt-get (like install, remove, update, upgrade) and apt-cache (like search, show). This reduces the need for users to remember multiple command names for common tasks.
USER EXPERIENCE
A key focus of apt's development was enhancing the user experience. This includes features such as colored output, a progress bar during installations, and clearer, more concise messages, making it easier for users to understand what's happening during package operations.
RECOMMENDED TOOL
For interactive use on the command line, apt is now the generally recommended package management tool over apt-get for most Debian and Ubuntu users due to its improved usability and merged functionalities. apt-get remains important for scripting purposes where its stable, predictable output is preferred.
HISTORY
The apt command itself is a relatively newer front-end for the Advanced Package Tool system, which has been the backbone of Debian's package management since 1998. It was introduced to provide a more consistent, user-friendly, and interactive experience than its predecessors, apt-get and apt-cache. The development focused on improving human readability of output, adding progress bars, and consolidating common functionalities into a single command, making it the de facto standard for interactive package management on modern Debian-based distributions like Ubuntu since its initial release in 2014-2016 versions. Its goal was to make package management more intuitive and less verbose for end-users, while retaining the power and flexibility of the underlying APT system.