Back to the command reference

apt-get

SystemFundamentalsReference only

Debian/Ubuntu package tool (script-friendly)

Name: apt-get = APT get

This command is outside what the site lets you practise (mostly distribution-specific or rarely used tools). This page describes how to use it; try it on your own Linux system.

Description

apt-get is APT's classic command-line tool. It does much the same as apt but its output is stable across versions, so it suits scripts and Dockerfiles, usually with -y.

Syntax

apt-get [OPTION]... COMMAND

Common options

updateRefresh the package lists
upgradeUpgrade every installed package
install / removeInstall / remove packages
purgeRemove including config files
autoremoveRemove unneeded dependencies
cleanEmpty the cache of downloaded packages
-y / --yesAssume yes
--no-install-recommendsInstall only what is required, not recommended packages
-s / --simulateShow what would happen without doing it

Examples

  • $ sudo apt-get install -y curl

    Install without prompting (for scripts)

    Explain

Related