apt(8)
Command-line interface for managing Debian packages; install, update, remove, and search for software.
Synopsis
apt [OPTION]... COMMAND [ARG]...Description
apt is a high-level package management tool that simplifies software installation and maintenance on Debian and Ubuntu systems. It combines functionality from apt-get and apt-cache, providing an intuitive interface for installing updates, managing dependencies, and resolving package conflicts.
Before using apt to install packages, update your package lists with apt update. Most operations require root privileges via sudo.
Common options
| Flag | What it does |
|---|---|
-y, --yes | Assume yes to all prompts; skip interactive confirmations |
-q, --quiet | Suppress output messages; useful for scripting |
-V, --verbose | Print extra information during operations |
--no-install-recommends | Skip recommended packages; install only dependencies |
--no-upgrade | Do not upgrade packages during install |
-s, --simulate | Simulate the operation without making changes |
--reinstall | Reinstall a package even if already installed |
--autoremove | Remove unused dependencies automatically |
Examples
Refresh package lists from configured repositories; run before installing new packages
sudo apt updateInstall the curl package and resolve all required dependencies
sudo apt install curlUpgrade all installed packages to their newest available versions
sudo apt upgradeUpgrade packages while intelligently handling dependency changes and removals
sudo apt full-upgradeSearch package lists for packages matching 'vim' without requiring sudo
apt search vimRemove the apache2 package while keeping its configuration files
sudo apt remove apache2Remove apache2 package and delete all associated configuration files
sudo apt purge apache2Remove packages that were automatically installed as dependencies and are no longer needed
sudo apt autoremove