How to Uninstall and Install nmap Ubuntu 22.04

Updated: September 21, 2022

Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques, version detection (determine service protocols and application versions listening behind ports), and TCP/IP fingerprinting (remote host OS or device identification). Nmap also offers flexible target and port specification, decoy/stealth scanning, sunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and commandline modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ. In this tutorial, I will show you how to install nmap on Ubuntu 22.04.

Prerequisites

  • Operating system: nmap needs Ubuntu 22.04 to work
  • Privileges: Make sure that you can run the sudo commands line.

Prerequisites to install nmap on Ubuntu 22.04

Install nmap Ubuntu 22.04

nmap is one of the popular ways on Ubuntu now so that this tutorial will show you how to install it in various ways. Choose the one you believe is simple and easy to follow.

Install nmap using APT

This is one of the most popular methods for installing Ubuntu packages since it is simple to understand, even if you are a Linux novice. Following these steps to install nmap on your Ubuntu.

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Obtain new packages from Ubuntu by updating the APT database. Launch the terminal and enter the following Linux command:

sudo apt-get update

Step 2: Start installing the packages on Ubuntu 22.04. After updating the system, you can install nmap Ubuntu by executing this command in the terminal.

sudo apt install nmap

Install nmap using Aptitude

If you haven’t already installed Aptitude on Ubuntu, run this command to do so.

sudo apt-get install aptitude

After that, you can now install nmap, just following these steps:

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Opening the terminal and executing the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install nmap Ubuntu by executing this command in the terminal.

sudo aptitude install nmap

Uninstall nmap on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu might be challenging? You’re wrong; any program, not just a nmap, can be easily uninstalled by anyone.

If you installed nmap using APT or Aptitude, you could uninstall nmap on Ubuntu by executing this command

sudo apt remove --auto-remove nmap

If you want to uninstall nmap and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge nmap

Summary

In this guide, I showed you ways to install nmap on Ubuntu 22.04 and some ways to uninstall nmap too. Please do not hesitate to contact me if you require assistance. I’m delighted to respond.