How to Fix ‘Failed to Fetch 404 Not Found’ Error in Ubuntu APT

When running sudo apt update or attempting to install software on Ubuntu, users often run into repository errors ending with ‘E: Failed to fetch http://… 404 Not Found’ followed by ‘W: Some index files failed to download. They have been ignored, or old ones used instead.’ This error indicates that the Advanced Package Tool (APT) cannot locate package indices at the specified repository URLs. It typically occurs when using an End-of-Life (EOL) Ubuntu release, when an external Personal Package Archive (PPA) is retired, or when repository addresses are mistyped in sources lists.

Why Does APT Return 404 Not Found?

Ubuntu distributes software packages through an extensive global network of mirror servers hosting precompiled Debian archives. Each distribution release (such as Noble Numbat 24.04, Jammy Jellyfish 22.04, or older interim releases like 23.10) maintains dedicated directories on these mirrors corresponding to repository components (main, restricted, universe, and multiverse).

When APT issues an HTTP GET request for a package catalogue (such as InRelease or Packages.gz) and the server returns a 404 status code, it is generally due to:

  • Your Ubuntu release has reached End-of-Life (EOL), causing Canonical to move its package trees from the primary archive to old-releases.ubuntu.com.
  • A third-party Launchpad PPA has been removed by its maintainer or does not provide packages for your current Ubuntu version.
  • Corrupted local repository cache files in /var/lib/apt/lists/ causing desynchronised package hash lookups.
  • Stale repository entries left behind after upgrading from one Ubuntu distribution version to another.

Method 1: Identify and Remove Deprecated or Missing PPAs

If the 404 error points to an external PPA (e.g., ppa.launchpadcontent.net), the repository author has likely discontinued support or never released packages for your release architecture.

  1. Carefully examine the terminal output of sudo apt update to spot the exact URL returning the 404 error.
  2. If the failing URL contains a PPA identifier, remove it using the add-apt-repository utility:
    sudo add-apt-repository --remove ppa:repositoryname/branch
    (Replace ppa:repositoryname/branch with the exact PPA string reported in your terminal).
  3. Alternatively, list all active third-party repository definition files:
    ls /etc/apt/sources.list.d/
  4. Delete or move the specific .list or .sources file triggering the 404 error:
    sudo rm /etc/apt/sources.list.d/failing-ppa.list
  5. Run sudo apt update to confirm the error is cleared.

Method 2: Update Repository Sources for End-of-Life (EOL) Ubuntu Versions

Interim Ubuntu releases are supported for 9 months, while Long-Term Support (LTS) releases receive 5 years of standard support. When a non-LTS version reaches its end of lifecycle, Canonical archives its repositories, relocating them from archive.ubuntu.com to old-releases.ubuntu.com.

  1. Check your current Ubuntu release version by running:
    lsb_release -a
  2. If your version is no longer officially supported, create a backup of your current sources list:
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
  3. Use the sed stream editor to replace all references to official archive and security mirrors with the official legacy archive URL:
    sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
  4. Refresh your repository database:
    sudo apt update
  5. Once repository access is restored, plan an immediate distribution upgrade to an actively supported Long-Term Support (LTS) release using sudo do-release-upgrade.

Method 3: Clear and Rebuild Local APT Cache Lists

Occasionally, an aborted network transfer or corrupted local list file prevents APT from reading repository indices properly.

  1. Remove all cached package index lists from your local storage:
    sudo rm -rf /var/lib/apt/lists/*
  2. Clean the local package cache:
    sudo apt clean
  3. Recreate the lists directory and download fresh metadata from all active mirrors:
    sudo apt update

Method 4: Switch to the Main Ubuntu Mirror

If you are using a localized regional mirror (e.g., uk.archive.ubuntu.com or in.archive.ubuntu.com) that is experiencing maintenance or sync lag, redirecting queries to the primary global cluster resolves mirror 404 faults.

  1. Open the Software & Updates utility from your desktop application launcher.
  2. Under the Ubuntu Software tab, locate the Download from dropdown menu.
  3. Change the selection from your country mirror to Main Server.
  4. Click Close. Ubuntu will prompt you to reload your software lists; click Reload to pull down the updated metadata.

By purging obsolete third-party PPAs and repointing retired Ubuntu versions to the proper legacy mirrors, you can successfully eliminate the 404 Not Found error and restore full package installation capabilities in APT.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.