Fixing 'E: Package has no installation candidate' on Ubuntu (python3-pip)

beginner🐧 Linux2026-04-29| Ubuntu 20.04, 22.04, 24.04 LTS, Debian 11/12, WSL2, Docker

Error Message

E: Package 'python3-pip' has no installation candidate
#apt#ubuntu#python#linux-admin

TL;DR: The 30-Second FixThis error usually crops up when your local package database is out of sync or a required repository isn't active. Most users can resolve it by running these three commands in order:

sudo apt update
sudo add-apt-repository universe
sudo apt update
sudo apt install python3-pip

What's actually going on?When Ubuntu throws the no installation candidate error, it's telling you that apt has heard of the package but can't find a valid download link for it. Think of it like a library catalog that lists a book title, but every shelf in the building is empty.

I see this most often on fresh WSL2 setups, stripped-down Docker containers, or cloud VPS instances that have been sitting idle for months. Several common factors lead to this state:

  • Stale Cache: Your system is looking for file versions that no longer exist on the mirrors.- Hidden Repositories: The package lives in 'Universe,' which many minimal installs disable to save space.- Version Mismatch: You might be searching for python-pip (the old Python 2 version) instead of python3-pip.- End of Life (EOL): You are running an older release like Ubuntu 21.10 that the official mirrors no longer host.## Step-by-Step Solutions### 1. Refresh the Package IndexEven if you ran an update an hour ago, do it again. Mirrors change frequently. This command forces your system to fetch the latest list of available software from Ubuntu's servers.
sudo apt update

Keep an eye on the terminal. If you spot lines starting with "Err" or "W:" (Warnings), you likely have a networking issue or an expired security key rather than a missing package. Fix those first.

2. Activate the Universe RepositoryStandard tools like python3-pip, htop, and ffmpeg aren't in the "Main" repository. They reside in Universe, a community-maintained tier. In minimal environments—especially Docker—this is often turned off by default.

Enable it with this command:

sudo add-apt-repository universe
sudo apt update

If your system says add-apt-repository: command not found, you're missing a small helper package (about 10MB). Install it first:

sudo apt update && sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update

3. Confirm the Package NameTypos are the silent killers of productivity. Linux is case-sensitive and naming conventions changed between Python 2 and 3. Use the search tool to see exactly what is available in your current repos:

apt-cache search pip | grep python3

If python3-pip doesn't appear in the results, your repositories are definitely misconfigured.

4. Repair your sources.listIf you're still stuck, your sources.list might be empty or pointing to the wrong URLs. Open it with a text editor:

sudo nano /etc/apt/sources.list

For a standard Ubuntu 22.04 (Jammy Jellyfish) system, you should see lines that look like this:

deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main universe restricted multiverse

If your file looks drastically different, replace the codename (e.g., "jammy" or "noble") with your specific version. You can find your codename by running lsb_release -c.

How to verify the fixBefore running the full 150MB+ installation, check if apt now sees a valid candidate:

apt-cache policy python3-pip

Success looks like this:

python3-pip:
  Installed: (none)
  Candidate: 22.0.2+dfsg-1ubuntu0.5
  Version table:
     22.0.2+dfsg-1ubuntu0.5 500
        500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages

If the "Candidate" line shows a version number instead of "(none)", you're ready. Go ahead and install:

sudo apt install python3-pip

Quick Repository Cheat Sheet- Main: Free, open-source, and officially supported by Canonical.- Universe: Free and open-source, but community-maintained.- Restricted: Proprietary drivers (like Nvidia).- Multiverse: Software burdened by copyright or legal hurdles.## Further Reading- Official Ubuntu Repo Management Guide- APT Manpages

Related Error Notes