community man page

apt-get

GNU

Debian and Ubuntu package management utility. Search for packages using `apt-cache`. It is recommended to use `apt` when used interactively in Ubuntu versions 16.04 and later.

8 examples·source: tldr · CC-BY·status: verified
Reading is open to everyone. Suggesting a flag, fixing an example or adding a recipe is opening to verified-email accounts soon — every change is moderated before it goes live.
curl https://curlhub.sh/man/apt-get
same page, in your terminal

Examples

Update the list of available packages and versions (it's recommended to run this before other `apt-get` commands) GNU

sudo apt-get update

Install a package, or update it to the latest available version GNU

sudo apt-get install package

Remove a package GNU

sudo apt-get remove package

Remove a package and its configuration files GNU

sudo apt-get purge package

Upgrade all installed packages to their newest available versions GNU

sudo apt-get upgrade

Clean the local repository - removing package files (`.deb`) from interrupted downloads that can no longer be downloaded GNU

sudo apt-get autoclean

Remove all packages that are no longer needed GNU

sudo apt-get autoremove

Upgrade installed packages (like `upgrade`), but remove obsolete packages and install additional packages to meet new dependencies GNU

sudo apt-get dist-upgrade