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-cache while adding features like progress bars and friendly notices/reminders. apt-get and apt-cache still exist and have not been deprecated.
apt [operation] [program]
For this tutorial, I am using the term "operation" to represent one of three options: install, upgrade, remove.
apt install [program]
apt install apache2
apt remove [program]
apt remove apache2
apt upgrade [program]
apt upgrade apache2
Install/remove/update multiple programs
apt [operation] [programs]
apt install apache2 mysql-server tidy software-properties-common
Install/remove/update multiple programs without confirmation
apt [operation] -y [programs]
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.