apt-get
Install, upgrade, and manage packages.
TLDR
Update the list of available packages
$ sudo apt-get update
Install a package or update it to the latest versioncopy
$ sudo apt-get install [package]
Remove a packagecopy
$ sudo apt-get remove [package]
Remove a package and its configuration filescopy
$ sudo apt-get purge [package]
Upgrade all installed packagescopy
$ sudo apt-get upgrade
Clean the local repository of interrupted downloadscopy
$ sudo apt-get autoclean
Remove all packages that are no longer neededcopy
$ sudo apt-get autoremove
Upgrade and handle changing dependenciescopy
$ sudo apt-get dist-upgrade
copy
SYNOPSIS
apt-get [options] command [package...]
DESCRIPTION
apt-get is the command-line package management utility for Debian and Ubuntu. It handles installation, upgrade, and removal of software packages. For interactive use, apt is recommended as a more user-friendly alternative.
PARAMETERS
update
Resynchronize package index files from sourcesupgrade
Install newest versions of all currently installed packagesdist-upgrade
Upgrade and handle changing dependenciesinstall package
Install or upgrade specified packagesremove package
Remove packagespurge package
Remove packages and configuration filesautoremove
Remove automatically installed packages no longer neededautoclean
Clear local repository of retrieved package files that can no longer be downloadedclean
Clear local repository of all retrieved package filesdownload package
Download the binary package into the current directorysource package
Fetch source packagesbuild-dep package
Install the build dependencies of a source packagesatisfy string
Satisfy dependency strings (as used in Build-Depends); prefix an argument with 'Conflicts: ' to express a conflict-y, --yes
Automatic yes to prompts; run non-interactively-s, --simulate
No action; simulate the events that would occur without changing the system-d, --download-only
Download packages but don't unpack or install--no-install-recommends
Don't install recommended packages--reinstall
Reinstall packages already at the newest version--only-upgrade
Only upgrade already-installed packages; ignore requests to install new ones-f, --fix-broken
Attempt to fix broken dependencies
CONFIGURATION
/etc/apt/sources.list
Package source repositories./etc/apt/apt.conf
Main APT configuration file./etc/apt/apt.conf.d/
Directory for drop-in configuration fragments.
CAVEATS
Run apt-get update before other commands to ensure the package list is current.
HISTORY
Part of the APT (Advanced Package Tool) suite developed for Debian in 1998 by the APT Development Team.