How To Install SQLmap on Linux Mint 22

SQL injection remains one of the most dangerous and widely exploited vulnerabilities in web applications. If you are a penetration tester, security researcher, or sysadmin who wants to test web applications for this type of flaw, learning how to install SQLmap on Linux Mint 22 is a practical, high-value skill. This guide walks you through four installation methods, from beginner-friendly to professional-grade, so you can pick the one that fits your workflow. By the end, you will have a fully working SQLmap setup, verified and ready to use on authorized targets.
What Is SQLmap and Why Does It Matter?
SQLmap is an open-source, Python-based penetration testing tool that automates the detection and exploitation of SQL injection vulnerabilities in web applications. It was first released in 2006 and remains the industry standard for SQL injection testing in 2026.
SQLmap supports all major database systems, including MySQL, PostgreSQL, Oracle, Microsoft SQL Server, and SQLite. Its detection engine handles five core injection techniques: boolean-based blind, time-based blind, error-based, union query-based, and stacked queries.
Security professionals trust SQLmap because it cuts hours of manual testing down to minutes. It can fingerprint the target database, enumerate tables and columns, extract data, and in some configurations, interact with the underlying operating system. Bug bounty hunters, red teamers, and developers running security audits all rely on it regularly.
Linux Mint 22 (codename “Wilma”) is based on Ubuntu 24.04 LTS and ships with Python 3.12 by default. That makes it an excellent platform for SQLmap, which requires Python 2.7 or any Python 3.x version.
Prerequisites Before You Begin
Before you run a single command, confirm your system meets these requirements:
- Operating System: Linux Mint 22 (Wilma), 22.1 (Xia), or 22.2 (Zara), all based on Ubuntu 24.04 LTS
- Python 3: Comes pre-installed on Mint 22; verify it with
python3 --version - sudo privileges: Required for system-wide installations
- Git: Needed for the Git clone method; check with
git --version - pip3: Needed for the pip method; check with
pip3 --version - Active internet connection: Required to download packages and clone repositories
- Terminal access: Press
Ctrl + Alt + Tto open a terminal
Run this command first to make sure your system is up to date:
sudo apt update && sudo apt upgrade -y
This refreshes your package lists and installs pending updates before you add any new tools. Skipping this step is a common cause of dependency conflicts during installation.
Step 1: Understand Your Installation Options
There are four ways to install SQLmap on Linux Mint 22. Each has a different trade-off between ease, version freshness, and flexibility.
| Method | Version | Difficulty | Auto-Update | Best For |
|---|---|---|---|---|
| APT | Stable (may lag) | Easy | No | Quick setup |
| Git Clone | Latest dev build | Moderate | Manual | Professionals |
| pip | Latest stable | Moderate | Manual | Python users |
| Snap | Stable | Easy | Yes | Convenience |
For most sysadmins and security testers, the Git clone method is the recommended choice because it pulls the latest development version directly from the official GitHub repository. The APT method is fine for quick setups, but the packaged version in Ubuntu’s repositories often lags behind the latest release.
Step 2: Install SQLmap via APT (Easiest Method)
The APT method is the fastest way to get SQLmap running on Linux Mint 22. It uses the Ubuntu 24.04 package repositories that Mint 22 inherits directly.
Update the Package Index
sudo apt update
This command syncs your local package list with the upstream repository. Always run it before installing anything new.
Install SQLmap
sudo apt install sqlmap -y
APT resolves and installs all dependencies automatically. The -y flag skips the confirmation prompt.
Verify the Installation
sqlmap --version
Expected output:
1.7.x#stable
Check the Help Menu
sqlmap -h
This prints the full list of options and switches. If you see output here, your APT installation is working correctly.
Limitation to know: The APT version may be several minor releases behind the latest build. For production-grade security testing, the Git clone method in Step 3 is a better choice because it always gives you the current development version.
How To Install SQLmap on Linux Mint 22 via Git Clone (Recommended Method)
The Git clone method pulls SQLmap directly from the official GitHub repository at https://github.com/sqlmapproject/sqlmap. This gives you the most current version with the latest bypass techniques, bug fixes, and database detection improvements.
Step 3.1: Install Git
Check whether Git is already installed:
git --version
If you see a version number, skip the next command. If not, install it:
sudo apt install git -y
Git is the version control system used to clone the SQLmap source code from GitHub.
Step 3.2: Clone the SQLmap Repository
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
Breaking this command down:
git clonefetches a copy of the repository--depth 1performs a shallow clone, downloading only the latest commit instead of the full history. This is faster and uses significantly less disk space.sqlmap-devis the local folder name where the files land
Expected output:
Cloning into 'sqlmap-dev'...
remote: Enumerating objects: 412, done.
Resolving deltas: 100% (312/312), done.
Step 3.3: Navigate to the Directory
cd sqlmap-dev
All SQLmap commands using this method must run from this directory unless you configure an alias (covered below).
Step 3.4: Set Execute Permissions
chmod +x sqlmap.py
This makes sqlmap.py executable so your shell can run it directly without explicitly calling Python first.
Step 3.5: Verify the Installation
python3 sqlmap.py --version
Expected output:
1.8.x#dev
The #dev suffix confirms you are running the latest development build from the Git repository.
Step 3.6: Create a System-Wide Alias (Highly Recommended)
Without an alias, you have to type python3 ~/sqlmap-dev/sqlmap.py every time. An alias lets you just type sqlmap from anywhere in the terminal.
echo "alias sqlmap='python3 ~/sqlmap-dev/sqlmap.py'" >> ~/.bashrc
source ~/.bashrc
The source ~/.bashrc command reloads your shell configuration so the alias takes effect immediately.
Test it:
sqlmap --version
Step 3.7: Keep SQLmap Updated
Because you used Git, updating to the latest version takes one command:
cd ~/sqlmap-dev && git pull
Run this regularly. SQLmap is actively maintained, and updates frequently add new WAF bypass scripts and detection improvements.
Step 4: Install SQLmap via pip (Python Users)
The pip method works well if you are already managing a Python development environment on Linux Mint 22. It installs SQLmap as a Python package from PyPI.
Install pip3
sudo apt install python3-pip -y
Important: Linux Mint 22 pip Restriction
Linux Mint 22 uses Ubuntu 24.04 as its base, which enforces a PEP 668 restriction that blocks system-wide pip install commands to protect system Python packages. If you try sudo pip3 install sqlmap directly, you may see:
error: externally-managed-environment
The clean fix is to use a virtual environment:
python3 -m venv sqlmap-env
source sqlmap-env/bin/activate
pip install sqlmap
This creates an isolated Python environment called sqlmap-env, activates it, and installs SQLmap inside it without touching your system Python.
Verify the Installation
sqlmap --version
Or use pip to confirm the package details:
python3 -m pip show sqlmap
To activate this environment in future sessions:
source ~/sqlmap-env/bin/activate
Step 5: Install SQLmap via Snap (Convenient and Auto-Updating)
Snap packages are sandboxed, auto-updating, and straightforward to install. This method suits users who want a maintenance-free setup.
sudo snap install sqlmap
Snap handles all dependencies automatically and keeps SQLmap updated in the background.
Verify the Installation
sqlmap --version
Snap installations live in /snap/bin/, which Linux Mint 22 includes in PATH by default. If sqlmap is not found, log out and back in to refresh environment variables.
Step 6: Basic SQLmap Usage Examples
Now that SQLmap is installed, here are the core commands you need to know. Practice these only on systems you own or on intentionally vulnerable applications like DVWA, bWAPP, or the public test target at http://testphp.vulnweb.com.
Test a URL for SQL Injection
sqlmap -u "http://testphp.vulnweb.com/artists.php?artist=1" --batch
The -u flag sets the target URL. The --batch flag skips all interactive prompts and uses default answers, which is useful for scripting.
Enumerate Available Databases
sqlmap -u "http://target.com/page.php?id=1" --dbs --batch
--dbs tells SQLmap to list all databases it can detect on the target server.
List Tables in a Specific Database
sqlmap -u "http://target.com/page.php?id=1" -D database_name --tables --batch
Test a POST Login Form
sqlmap -u "http://target.com/login.php" --data="username=admin&password=test" --batch
The --data flag sends the payload as POST body parameters, mimicking a form submission.
Adjust Detection Depth and Risk
sqlmap -u "http://target.com/page.php?id=1" --level=3 --risk=2 --batch
--level(1-5): Higher levels run more tests and test more injection points. Default is 1.--risk(1-3): Higher risk uses more aggressive payloads. Default is 1.
Start conservative with level 1 and risk 1. Increase only when initial scans return no results.
Troubleshooting Common Issues on Linux Mint 22
Error: “sqlmap: command not found” After APT Install
Run which sqlmap to confirm the binary location. If APT installed it but the shell cannot find it, your PATH variable may be misconfigured. Fix it by adding /usr/bin to PATH:
export PATH=$PATH:/usr/bin
source ~/.bashrc
Error: “externally-managed-environment” with pip
This is a Linux Mint 22-specific issue caused by the Ubuntu 24.04 PEP 668 enforcement. Use a virtual environment as shown in Step 4. Do not use --break-system-packages unless you fully understand the risks to your system Python.
Error: “Permission denied” on sqlmap.py
You forgot to set execute permissions. Run:
chmod +x ~/sqlmap-dev/sqlmap.py
Python Version Conflict
SQLmap requires Python 2.7 or Python 3.x. Linux Mint 22 ships Python 3.12, which is fully compatible. Confirm with:
python3 --version
If for some reason python3 is missing, install it:
sudo apt install python3 -y
Slow or Failed Git Clone
If the clone times out or stalls, your network may be throttling GitHub traffic. Try adding --depth 1 if you forgot it, or use the HTTPS URL instead of SSH:
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
SQLmap Key Flags Quick Reference
| Flag | What It Does |
|---|---|
-u URL |
Set the target URL |
--dbs |
Enumerate all databases |
--tables |
List tables in a database |
--columns |
List columns in a table |
--dump |
Extract data from a table |
--batch |
Skip all interactive prompts |
--level=N |
Set test depth (1-5) |
--risk=N |
Set payload risk (1-3) |
--random-agent |
Randomize HTTP User-Agent |
--tor |
Route traffic through Tor |
--tamper=SCRIPT |
Apply WAF bypass script |
--proxy=URL |
Route through a proxy (e.g., Burp Suite) |