12.3 Managing Packages with APT
The apt tool provides a way to perform most package management tasks directly from the command line. In this section we will explore some of the more frequently used apt command-line options.
An Ubuntu system keeps a local copy of the latest package information and, as such, it is recommended that this list be updated before performing any other apt operations as follows:
# apt update
One of the most common apt activities is to perform a package installation:
# apt install package_name
Similarly, an installed package may be removed from the system using the remove option:
# apt remove package_name
When a package is removed this way, configuration files associated with the package will remain on the system. This allows the package to be reinstalled later without losing any custom configuration settings. To remove these files either during the deletion, or even after the deletion as been performed, use the purge option:
# apt purge...