Maintaining an Ubuntu Linux workstation or production server requires keeping package catalogs up to date using the Advanced Package Tool (APT). However, executing sudo apt update only to be greeted by error strings such as “E: Failed to fetch http://… 404 Not Found” and “W: Some index files failed to download” brings package upgrades, security patches, and software installations to an immediate halt. In Ubuntu, APT queries package archive repositories defined in /etc/apt/sources.list and the /etc/apt/sources.list.d/ directory. When remote repository mirrors are decommissioned, third-party Personal Package Archives (PPAs) are discontinued, or your installed Ubuntu release reaches End of Life (EOL), APT cannot retrieve the required Release or InRelease catalog files. This technical guide outlines how APT repository indexing works and provides practical methods to resolve 404 fetch errors on Ubuntu.
Why Does apt Update Fail with ‘404 Not Found’?
When APT connects to an archive server, it requests the cryptographic release manifests for your specific Ubuntu codename (e.g. noble, jammy, or focal). The HTTP 404 response indicates that the requested file path no longer exists on the remote web server. Common causes include:
- End-of-Life (EOL) Ubuntu Release: Short-term interim Ubuntu releases (supported for 9 months) reaching their end of support. Once a version reaches EOL, Canonical moves its package archives from
archive.ubuntu.comtoold-releases.ubuntu.com. - Abandoned or Obsolete PPAs: Third-party Launchpad PPAs that have not published packages for your newer version of Ubuntu.
- Regional Mirror Downtime or Sync Lag: Regional Ubuntu mirrors (such as country-code mirrors like
in.archive.ubuntu.com) experiencing server outages or missing repository index synchronization. - Corrupted Local Package Lists: Partially downloaded index files in
/var/lib/apt/lists/causing checksum mismatches and request aborts. - Architecture Incompatibilities: Repositories lacking binary packages for 32-bit (
i386) or ARM architectures when multiarch support is enabled on the system.
Method 1: Identify and Remove Broken PPAs
Carefully reading the terminal error output reveals the exact PPA URL that returned the 404 error.
- Run
sudo apt updateand inspect the output. - Locate the line beginning with
W: Failed to fetchorE: The repository 'https://ppa.launchpadcontent.net/... Release' does not have a Release file. - Note the name of the failing PPA (e.g.
ppa:author/software-name). - Remove the offending PPA using the
add-apt-repositoryutility:sudo add-apt-repository --remove ppa:author/software-name - Alternatively, remove the corresponding
.listfile from the sources directory:sudo rm /etc/apt/sources.list.d/author-ubuntu-software-name-*.list - Run
sudo apt updateagain to confirm the error is cleared.
Method 2: Switch to Canonical's Main Ubuntu Archive Mirrors
If a regional country mirror is down, redirecting your APT configuration to Canonical's primary global mirror restores package availability.
- Create a backup copy of your current sources configuration:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup - Open
/etc/apt/sources.listin a text editor:sudo nano /etc/apt/sources.list - Search for country-specific prefixes (e.g.
http://us.archive.ubuntu.com/orhttp://uk.archive.ubuntu.com/). - Replace them with the main global mirror:
http://archive.ubuntu.com/ubuntu/ - On Ubuntu 24.04 and newer using deb822-style formatting, edit
/etc/apt/sources.list.d/ubuntu.sourcesinstead. - Save changes with Ctrl + O, press Enter, and exit with Ctrl + X.
- Execute
sudo apt updateto fetch fresh repository indexes.
Method 3: Point End-of-Life Ubuntu Releases to old-releases.ubuntu.com
If you are running an unsupported interim release of Ubuntu, redirecting repository URLs to Canonical's archive server enables package updates.
- Verify your current release codename:
lsb_release -a - If your version is officially EOL, run the following
sedcommands to redirect repository entries from standard mirrors toold-releases: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 - Update package lists:
sudo apt update - All 404 errors will resolve immediately. You should then plan to upgrade your operating system to a supported Long Term Support (LTS) release using
sudo do-release-upgrade.
Method 4: Purge Stale and Corrupted APT Lists
Deleting cached repository list files forces APT to rebuild its entire index catalog from scratch.
- Clean the local repository package cache:
sudo apt clean - Remove all downloaded index files from the local storage cache:
sudo rm -rf /var/lib/apt/lists/* - Create a clean lists directory:
sudo mkdir -p /var/lib/apt/lists/partial - Perform a complete re-index:
sudo apt update
Method 5: Fix Multiarch Architecture Filters
Third-party repositories often publish packages exclusively for 64-bit AMD64 architecture, triggering 404 errors when an Ubuntu system has 32-bit i386 architecture enabled for Wine or Steam.
- Open the specific third-party repository file in
/etc/apt/sources.list.d/. - Locate the repository deb line:
deb http://repo.example.com/ubuntu/ noble main - Add the architecture filter directly after
deb:deb [arch=amd64] http://repo.example.com/ubuntu/ noble main - Save and exit the file. APT will now ignore 32-bit queries for that repository, resolving the missing package list failure.
For additional Linux troubleshooting tutorials and server administration tips, visit the Digitash Ubuntu section.