Install, Update and Remove Linux/Ubuntu Software (APT)

apt is the Advance Packaging Tool, a program for managing packages (software) on your Linux computer/server. APT allows software to be installed, updated and removed.

APT is provided by Debian, the organization that produces the source code that is the basis of Linux distributions like Ubuntu, Elemntary OS, and Linux Mint. If you are using such a distro, you can use APT.

APT consolidates most of the functionality in apt-get and apt-cache while adding features like progress bars and friendly notices/reminders. apt-get and apt-cache still exist and have not been deprecated.

Basic Syntax

apt [operation] [program]

Operations

For this tutorial, I am using the term "operation" to represent one of three options: install, upgrade, remove.

Install Software

Syntax

apt install [program]

Example

apt install apache2

Remove Software

Syntax

apt remove [program]

Example

apt remove apache2

Upgrade Software

Syntax

apt upgrade [program]

Example

apt upgrade apache2

Install/remove/update multiple programs

Syntax

apt [operation] [programs]

Example

apt install apache2 mysql-server tidy software-properties-common

Install/remove/update multiple programs without confirmation

Syntax

apt [operation] -y [programs]

Example

apt install -y apache2 mysql-server tidy software-properties-common

Update vs Upgrade

This may be a bit confusing.

The "upgrade" operation is used to update software that you have installed.

The "update" operation is used to update your database of available packages.


When you use an app store on your computer or mobile device, you can search for all of the software available and choose what you wish to download.

But Linux is different. Using APT, you must download a master record of the software available for installation. If you want to use software that became available after your downloaded the database, you will not be able to find or install it via APT. So you must execute an "update" command to update your software database.

Generally, you should execute the apt update command before you install or upgrade software on your computer/server.