the apt-get command is a powerful command-line tool used to work with Ubuntu’sAdvanced 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.


sudo apt-get install nmap

  • Update the Package Index: The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file. To update the local package index with the latest changes made in repositories, type the following:
    sudo apt-get update
  • Upgrade Packages: Over time, updated versions of packages currently installed on your computer may become available from the package repositories (for example security updated). To upgrade your system, first update your package index as outlined above, and then type:
    sudo apt-get upgrade