The apt command is a powerful command-line tool, which works with Ubuntu’s Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system.
Some examples of popular uses for the apt utility:
Install a Package: Installation of packages using the apt tool is quite simple. For example, to install the nmap network scanner, type the following:
sudo apt install nmap
Remove a Package: Removal of a package (or packages) is also straightforward. To remove the package installed in the previous example, type the following:
sudo apt remove nmap
auto remove package
sudo apt autoremove