On Linux operating systems that use the APT package management system, the apt-get command is used to install, remove, and perform other operations on installed software packages.

The apt-get command, and other core APT utilities, are available by default in the Debian, Ubuntu, and Linux Mint operating systems.

Syntax

apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {update | upgrade | dselect-upgrade | dist-upgrade | install pkg [{=pkg_version_number | /target_release}]… | remove pkg… | purge pkg… | source pkg [{=pkg_version_number | /target_release}]… | build-dep pkg [{=pkg_version_number | /target_release}]… | download pkg [{=pkg_version_number | /target_release}]… | check | clean | autoclean | autoremove | {-v | –version} | {-h | –help}}

Commands

Options

All command line options may be set using the configuration file; the descriptions indicate the configuration option to set. For boolean options you can override the config file using something like -f-,–no-f, or -f=no.

  • Syntax
  • Examples
  • Related commands
  • Linux commands help

Files

Examples

sudo apt-get install libc6

Install libc6, which comprises the shared libraries of the embedded GNU C library.

Many (if not most) apt-get operations require write access to the APT lock file, which requires administrator privileges — so most commands listed here are prefixed with sudo, and require your password.

sudo apt-get remove chromium

Remove chromium, the Chromium web browser package.

sudo apt-get clean

Clean the local repository of downloaded package files, clearing disk space.

apt-get download ruby

Download the archive file for the package named ruby into the current directory. The file has the .deb extension (in this case, ruby_x.x.x_all.deb). You could then install the package manually with dpkg –install.

apt — A unified APT front end for the command line.apt-cache — Get information about software packages available through APT.apt-file — Search for individual files in all available APT packages.apt-mark — Change or view the settings of individual APT packages.aptitude — Text-based front end for the APT package management system.dpkg — Install, remove, and maintain Debian software packages.