apt-get
TLDR
Update the list of available packages
$ sudo apt-get update
Install a package or update it to the latest version$ sudo apt-get install [package]
Remove a package$ sudo apt-get remove [package]
Remove a package and its configuration files$ sudo apt-get purge [package]
Upgrade all installed packages$ sudo apt-get upgrade
Clean the local repository of interrupted downloads$ sudo apt-get autoclean
Remove all packages that are no longer needed$ sudo apt-get autoremove
Upgrade and handle changing dependencies$ sudo apt-get dist-upgrade
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 packages-y, --yes
Automatic yes to prompts-d, --download-only
Download packages but don't install--no-install-recommends
Don't install recommended packages-f, --fix-broken
Attempt to fix broken dependencies
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.


