Fix "E: Failed to fetch ... 404 Not Found" in apt

Quick fix

Your package lists are probably out of date. Refresh them and run the same command again.

sudo apt update
sudo apt install packagename      # or: sudo apt upgrade

The full output usually looks like this:

Err:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libssl3t64 amd64 3.0.13-0ubuntu3.4
  404  Not Found [IP: 185.125.190.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl3t64_3.0.13-0ubuntu3.4_amd64.deb  404  Not Found [IP: 185.125.190.81 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

What the error means

apt downloads packages based on its local index in /var/lib/apt/lists/, which it refreshes when you run apt update. The index says "version X of this package is at this path". A 404 means the server answered, but that file is not there any more.

First look at which URL failed, because it tells you which page you need:

Failing URL containsMeaningFix
/pool/.../something.debOne package file is gone; the repository is fineThis page, causes 1 to 4
/dists/codename/InRelease or ReleaseThe whole release or repository is missing at that URLRepository does not have a Release file
ppa.launchpadcontent.netA PPA package or the PPA itself is goneCause 4

Cause 1: stale package lists

This is the cause most of the time. Ubuntu and Debian replace package versions in -updates and -security regularly, and old versions are removed from the pool after a while. If your last apt update was days or weeks ago, apt asks for a version that no longer exists. Refreshing the index makes apt request the current version:

sudo apt update
sudo apt upgrade

If apt update itself prints errors, fix those first; otherwise the index stays stale. A GPG warning there points to NO_PUBKEY; a missing Release file to the page linked above.

The hint about --fix-missing in the error is misleading: it makes apt skip the missing packages and continue, which can leave you with a partial upgrade. Only use it after apt update did not help and you understand which packages are skipped.

Cause 2: Docker and CI layer caching

In container builds, this error appears weeks after a Dockerfile worked fine. Docker cached the layer that ran apt-get update, so a later apt-get install layer uses the old index:

# problem: update is cached separately
RUN apt-get update
RUN apt-get install -y curl

Always update and install in the same RUN instruction, so they are cached (and invalidated) together:

RUN apt-get update \
 && apt-get install -y --no-install-recommends curl \
 && rm -rf /var/lib/apt/lists/*

For an existing image, rebuild with docker build --no-cache . or --pull to also refresh the base image. CI caches of /var/lib/apt/lists cause the same problem. More on images in Docker on Linux.

Cause 3: a broken or out-of-sync mirror

Country mirrors such as de.archive.ubuntu.com, or a university or hosting provider mirror, sync from the main archive on a schedule. During or after a failed sync, the index and the files can disagree. If apt update did not help and the failing host is a mirror, switch to the main archive:

# Ubuntu 24.04+ (deb822 format)
grep -n URIs /etc/apt/sources.list.d/ubuntu.sources
sudo sed -i 's|http://[a-z]*\.archive\.ubuntu\.com|http://archive.ubuntu.com|' /etc/apt/sources.list.d/ubuntu.sources
# Debian: deb.debian.org is a CDN that picks a good mirror automatically
grep -rn URIs /etc/apt/sources.list.d/ /etc/apt/sources.list 2>/dev/null
sudo apt update

On Debian, use http://deb.debian.org/debian and http://security.debian.org/debian-security. On older Ubuntu installs the URLs live in /etc/apt/sources.list. Our apt guide explains both source formats.

An HTTP proxy or a local cache such as apt-cacher-ng can also serve stale data. Clear its cache, or bypass it to test with sudo apt -o Acquire::http::Proxy=false update. A captive portal (hotel or public Wi-Fi login page) can produce 404s or hash mismatches too; open a browser and log in first.

Cause 4: a PPA or third-party repository changed

PPAs and vendor repositories delete old versions more aggressively than the main archive, and some disappear entirely. If the failing URL is a PPA or a vendor host, refresh first; if the 404 persists for the repository's index, the source no longer supports your release. List third-party sources:

ls /etc/apt/sources.list.d/

Disable the offending one by moving it away (or setting Enabled: no in a .sources file), then update:

sudo mv /etc/apt/sources.list.d/some-ppa.sources /root/
sudo apt update

Check the vendor's current install instructions: many projects moved their repository URL or signing key in recent years, and the old URL now returns 404.

Cause 5: an end-of-life release

When an Ubuntu release reaches end of life, its packages are removed from archive.ubuntu.com and security.ubuntu.com and moved to old-releases.ubuntu.com. Ubuntu 25.10 reached EOL in July 2026, so a 25.10 system now gets 404 errors for everything. The fix is to point apt at old-releases briefly and upgrade to a supported release; the steps are on the no Release file page and in the Ubuntu upgrade guide. Debian releases past LTS move to archive.debian.org in the same way.

Distro notes

  • Linux Mint: Mint's own packages come from packages.linuxmint.com, the rest from Ubuntu (or Debian for LMDE). Use the Software Sources tool to pick another mirror if one is broken; the sources are in /etc/apt/sources.list.d/official-package-repositories.list.
  • Kali and Debian testing/unstable: packages change daily, so an index older than a day or two can already give 404s. Always apt update right before installing.
  • Raspberry Pi OS: uses archive.raspberrypi.com plus Debian mirrors; same fixes apply.
  • Fedora (dnf): the equivalent is a Status code: 404 during download. Refresh metadata with sudo dnf clean metadata and sudo dnf upgrade --refresh; see Failed to download metadata.
  • Arch (pacman): failed retrieving file ... 404 means your sync database is outdated. Run sudo pacman -Syu (never -Sy plus a single package, which creates a partial upgrade).
  • openSUSE (zypper): run sudo zypper refresh, then retry.

How to prevent it

  • Run sudo apt update immediately before every install or upgrade; scripts should do the same.
  • In Dockerfiles, keep apt-get update and apt-get install in one RUN line.
  • Use the default archive or deb.debian.org unless you have a reason to pin a specific mirror.
  • Track your release's support dates and upgrade before end of life.

Frequently asked questions

Why does apt say 404 Not Found?

apt requested a file listed in its local package index, but the server no longer has it. Usually the index is old and the package has been replaced by a newer version, so sudo apt update fixes it.

Does apt-get install --fix-missing fix 404 errors?

Rarely. It only skips the packages that failed to download. Refresh the package lists with sudo apt update first; that is what actually fixes a stale index.

Why do I get 404 in a Docker build?

Docker cached an old RUN apt-get update layer, so the install step uses outdated package lists. Combine update and install in a single RUN line, or rebuild with --no-cache.

What if the 404 is for a Release or InRelease file?

Then the whole repository or release is gone from that URL, not just one package. That is covered on our no Release file page: typically an end-of-life release or a PPA without builds for your version.

Spotted a mistake or a command that no longer works? Send a correction — pages are re-checked when reports come in.