How to Install Nmap on Fedora Linux
In just a few minutes you’ll have the network‑scanning powerhouse Nmap up and running on your Fedora box, ready to audit your Wi‑Fi or check those rogue devices after a firmware blip.
1. Check what’s already there
Before we do anything, let me save you some time: if you’ve ever tried nmap in the terminal and got “command not found,” Fedora is probably missing the package entirely or you’re running an older release that only ships with a stub. Open a shell and run
which nmap
If it returns nothing, move on. If it points to /usr/bin/nmap, you might already have the core tool but not the extras—just a heads‑up for later.
2. Add the Fedora Extra Packages (if needed)
Most recent Fedora releases ship Nmap in the standard repos, but if your system is out of date or you’re on a minimal install, you might need to enable the updates repo first:
sudo dnf update -y
After that, check again. If it’s still missing, you can pull from the official Fedora package set with no hassle.
3. Install via DNF
Fedora’s package manager is a one‑liner for Nmap:
sudo dnf install nmap -y
That pulls in both the binary and the man page, plus a handful of helper scripts that let you run nmap --script without extra fuss. Why do this? Because DNF will automatically resolve any dependencies, so you won’t end up with a half‑working scanner that fails on “libpcap missing” later.
4. Verify the install
Run:
nmap --version
You should see something like Nmap 7.93 ( https://nmap.org ). If you get a version string, congratulations—you’re live!
If you still get “command not found,” double‑check that /usr/bin is in your PATH:
echo $PATH | tr ':' '\n' | grep /usr/bin
You’ll usually see it there. If not, edit ~/.profile or ~/.bashrc to add it.
5. Quick sanity test
Scan your own loopback interface:
sudo nmap -sS 127.0.0.1
You should see a handful of open ports—at least the standard ones like 22 for SSH. If you’re scanning a router that just flashed new firmware, this will confirm whether it’s still exposing default credentials.
6. Optional: Enable Nmap Scripting Engine (NSE) support
The nmap-nselib package provides the Lua scripts used for advanced scans. It usually comes with the base install, but if you need it explicitly:
sudo dnf install nmap-nselib -y
Now you can run a quick vulnerability scan on your internal network:
sudo nmap --script vuln 192.168.1.0/24
Be careful with that; some networks will see it as suspicious and may lock out your IP.
7. Keep it up to date
Just like any other package, keep Nmap current:
sudo dnf upgrade nmap -y
That way you get the latest exploits and performance fixes. I’ve seen folks hit a wall when their old Nmap version didn’t recognize new service banners after an OS update.
8. Clean up
If something goes sideways, you can remove it cleanly:
sudo dnf remove nmap -y
No residual files left behind—Fedora’s DNF is tidy about that.
That’s all the heavy lifting. Grab your terminal and let Nmap do its thing; if anything feels off, check the logs in /var/log/dnf.log or just ping me for a quick troubleshoot session.