In a previous post, I explained how to install APT on a Linux server that does not have it. In this post, you learn how to use APT on any server that has it installed. Debian and Debian-based distributions, such as Ubuntu, use APT by default. The basic command for APT is “apt-get” in combination with other indicators. For example, if you want to install something, you use “apt-get install”.
To install Apache 2, you would type as root (or preceded by sudo):
apt-get install apache2
(or whatever the name for Apache is in your distribution)
APT uses a cache of repository lists to determine if something is available. Before installing anything, be sure to update the cache:
apt-get update
To remove an application, replace “install” with “remove”:
apt-get remove apache2
Be very careful with APT and keep in mind that any applications you install or uninstall will affect your server and every user account on it.