Package Management

apt-get

APT package handling utility for installing, upgrading, and removing packages.

Synopsis

syntax
apt-get [OPTION]... COMMAND [PACKAGE]...

Examples

Refresh package lists
sudo apt-get update
Install packages without prompting
sudo apt-get install -y curl wget
Full upgrade with dependency changes
sudo apt-get dist-upgrade
Clear local package cache
sudo apt-get clean

Common options

FlagDescription
installInstall packages
removeRemove packages
updateRefresh package lists
upgradeUpgrade packages
dist-upgradeSmart upgrade handling dependencies
-yAssume yes to prompts

About apt-get

The `apt-get` command aPT package handling utility for installing, upgrading, and removing packages. Package management commands install, update, and remove software on Linux distributions.

Each distribution family has its own package manager — apt for Debian/Ubuntu, yum/dnf for RHEL/Fedora, pacman for Arch, and so on. Understanding your distro's package manager is one of the first steps in Linux administration.

The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man apt-get`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Package Management Commands

Other commands in the Package Management category

Related tools