Executing sudo apt update or attempting to install software packages on an Ubuntu system only to encounter an avalanche of red error messages stating: E: Failed to fetch http://archive.ubuntu.com/ubuntu/... 404 Not Found [IP: 91.189.91.39 80] and E: Some index files failed to download. They have been ignored, or old ones used instead prevents software installations and security patches. An HTTP 404 error during APT package updates indicates that the URL requested by APT does not exist on the mirror server. This occurs when an Ubuntu release reaches End of Life (EOL) and its repositories are migrated from the main archive mirrors to the old-releases server, or when a third-party Personal Package Archive (PPA) is deleted or does not support your specific Ubuntu version. This guide outlines how to repair package lists and resolve 404 Not Found APT errors.
What Causes “Failed to fetch 404 Not Found” in APT?
HTTP 404 repository errors in Ubuntu stem from repository lifecycle transitions and dead external PPAs:
- End of Life (EOL) Ubuntu Release: Short-term Ubuntu releases (non-LTS builds supported for only 9 months) or older LTS versions past their support window having their packages purged from
archive.ubuntu.comand moved toold-releases.ubuntu.com. - Deprecated or Removed Third-Party PPAs: A software developer deleting their Launchpad PPA repository, or a PPA lacking package builds for your current Ubuntu release codename.
- Typographical Errors in sources.list: Misspelled release codenames (e.g. focal, jammy, noble) or corrupted repository component syntax.
- Outdated or Corrupted Package List Metadata: Damaged partial lists stored in
/var/lib/apt/lists/partial/causing hash and path mismatches.
Method 1: Identify Your Ubuntu Release and Support Status
Determining whether your Ubuntu release is currently supported dictates whether you need to redirect to the old-releases repository.
- In your terminal, run:
lsb_release -a - Note your Release (e.g. 21.04, 22.10, 20.04) and Codename (e.g. hirsute, kinetic, focal).
- Check if your version is an End of Life release:
- Standard interim releases (e.g. 21.04, 21.10, 22.10, 23.04, 23.10) reach EOL after 9 months.
- Long Term Support (LTS) releases (e.g. 20.04, 22.04, 24.04) receive 5 years of standard support.
Method 2: Redirect EOL Releases to old-releases.ubuntu.com
If your Ubuntu version has reached End of Life, redirecting your APT sources to the official Ubuntu archive server restores full package installation capabilities.
- Back up your existing sources list:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup - Use
sedto replace all instances ofarchive.ubuntu.comandsecurity.ubuntu.comwithold-releases.ubuntu.com:sudo sed -i -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list sudo sed -i -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list - Clean the existing local package cache:
sudo apt clean sudo rm -rf /var/lib/apt/lists/* - Run update:
All official package repositories will now fetch cleanly from old-releases without 404 errors.sudo apt update
Method 3: Remove Broken Third-Party PPAs
If the 404 error references an external Launchpad PPA (e.g. http://ppa.launchpad.net/... 404 Not Found), removing the dead PPA resolves the error.
- Review the exact name of the failing PPA from the error output (e.g. ppa:example/testing).
- Remove the offending PPA using
add-apt-repository:sudo add-apt-repository --remove ppa:username/ppa-name - If
add-apt-repositoryis not installed or fails, navigate to the PPA directory:cd /etc/apt/sources.list.d/ ls -la - Delete or move the
.listfile corresponding to the broken PPA:sudo rm /etc/apt/sources.list.d/broken-ppa.list - Run
sudo apt updateto confirm clean synchronisation.
Method 4: Fix 404 Errors on Docker Official Repositories
When installing Docker or other tools on brand-new Ubuntu versions, repositories may not yet have published packages for your codename.
- Inspect
/etc/apt/sources.list.d/docker.list. - If your current Ubuntu release is very new (e.g. Noble 24.04), and Docker returns 404, temporarily change the codename in the
.listfile to the previous LTS release (e.g. jammy):sudo nano /etc/apt/sources.list.d/docker.list - Save the file and run
sudo apt update.
Ubuntu APT 404 Troubleshooting Matrix
| Failing URL Domain | Underlying Cause | Immediate Remediation |
|---|---|---|
archive.ubuntu.com/ubuntu |
Ubuntu release has reached End of Life (EOL) | Replace archive URLs with old-releases.ubuntu.com |
ppa.launchpad.net/... |
Developer deleted PPA or no builds for your Ubuntu version | Remove PPA via add-apt-repository --remove or delete .list file |
download.docker.com/... |
Package maintainer has not published builds for your codename | Switch repository codename to previous LTS release in .list file |
packages.microsoft.com/... |
Incorrect architecture (e.g. arm64 instead of amd64) | Ensure [arch=amd64] flag is specified in sources.list line |
Frequently Asked Questions
Can I upgrade an End of Life Ubuntu release to a supported version?
Yes. Once you have pointed your sources to old-releases.ubuntu.com and completed sudo apt update && sudo apt dist-upgrade, you can execute sudo do-release-upgrade to upgrade step-by-step to the next supported release.
Why does apt clean help with 404 errors?
APT caches package list manifests locally in /var/lib/apt/lists/. If a network disruption leaves partially downloaded index files on disk, APT may attempt to fetch individual package hashes from invalid server locations until the local lists are wiped and rebuilt.