Pages

Topics

Tools

↑↓navigate↵openescclose
All guides

apt: The repository does not have a Release file

apt disables any repository whose Release file returns 404. Correct the suite name, move an end-of-life release to the archive host, or remove a dead repo.

~5 min readLinux
#linux#apt#debian#ubuntu
apt repository index crate with a missing Release file slab and an archive mirror beside it

Introduction & Quick Summary

apt update ends with a line that stops the whole upgrade path:

code
E: The repository 'http://deb.debian.org/debian bullseye Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

Quick answer: apt asked the mirror for <suite>/Release and the server answered 404, so it disables that repository. Either the suite no longer exists on that mirror (a release that reached end of life moved to an archive), the codename in sources.list is wrong, or a third-party repository has been deleted. Confirm the distribution first, then point the entry at the right place:

bash
cat /etc/os-release # ID and VERSION_CODENAME lsb_release -cs # the suite name apt uses apt-cache policy | head -20 # where every configured repo points

For a Debian release that is out of support, the fix is the archive host rather than the normal mirror:

bash
sudo sed -i 's|deb.debian.org/debian|archive.debian.org/debian|g; s|security.debian.org|archive.debian.org/debian-security|g' /etc/apt/sources.list sudo apt -o Acquire::Check-Valid-Until=false update

For anything still supported, the cause is a typo, a dead third-party entry, or a proxy returning an HTML page instead of a Release file. This guide walks through each, with the checks that tell them apart.

Core Mechanics, Signatures & Reproducible Setup

Every apt repository is a directory tree served over HTTP(S): dists/<suite>/Release, dists/<suite>/InRelease, Packages.gz, and per-component indexes. apt fetches Release (or the signed InRelease) first and refuses the repository if it cannot get one.

curl -sI http://deb.debian.org/debian/dists/bullseye/Release | head -3 # HTTP/1.1 404 Not Found <- the mirror moved the suite curl -sI http://archive.debian.org/debian/dists/bullseye/Release | head -3 # HTTP/1.1 200 OK

The message has three common shapes, each pointing at a different layer:

  • does not have a Release file — the URL path does not exist (404). Wrong codename, removed suite, dead third-party repo.
  • The following signatures couldn't be verified because the public key is not available — see the NO_PUBKEY error, which is a key problem, not a missing file.
  • Release file ... is expired — the file exists but its Valid-Until date has passed; that is the archive case and is fixed with Check-Valid-Until=false or a different mirror.

A reproduction with a wrong suite name makes the failure obvious:

bash
echo "deb http://deb.debian.org/debian bookwormy main" | sudo tee /etc/apt/sources.list.d/typo.list sudo apt update # E: The repository 'http://deb.debian.org/debian bookwormy Release' does not have a Release file. sudo rm /etc/apt/sources.list.d/typo.list

Key Comparison Table

Message fragmentMeaningFix
does not have a Release fileURL returns 404correct the suite or move to the archive
Release file ... is expiredValid-Until passedarchive host plus Check-Valid-Until=false
NO_PUBKEYsigning key missinginstall the key into keyrings
403 Forbidden on Releasemirror blocks the agent or countryswitch mirror or use a proxy
Clearsigned file isn't valid, got 'NOSPLIT'server returned HTMLfix the proxy or URL
Unable to locate packageindex never loadedresolve the repository error first
ReleaseStatusArchive base URL
Debian 11 bullseyeLTS ended 2026http://archive.debian.org/debian
Debian 12 bookwormsupportedhttp://deb.debian.org/debian
Debian 13 trixiesupportedhttp://deb.debian.org/debian
Ubuntu 20.04 focalsupported until 2030 (ESM)normal mirrors
Ubuntu 18.04 bionicstandard support endedhttp://old-releases.ubuntu.com/ubuntu
Ubuntu 16.04 xenialstandard support endedhttp://old-releases.ubuntu.com/ubuntu
CheckCommandWhat it proves
suite namelsb_release -cswhat apt expects in the URL
repository URLsapt-cache policywhich hosts and suites are configured
raw HTTP statuscurl -sI <url>/dists/<suite>/Releasewhether the file exists
which file defines itgrep -r "" /etc/apt/sources.list.d/where to edit
key stateapt-key list (deprecated) or ls /etc/apt/keyringswhether the repo is signed

Practical Edge Cases, Error Fixes & Deep Dive Code Examples

1. Get the codename right

A single wrong letter in a suite name produces exactly this error. Compare what apt thinks the release is with what the URL contains:

bash
. /etc/os-release && echo "$VERSION_CODENAME" grep -RhE "^deb|^URIs" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null

Debian 12 must say bookworm, Ubuntu 24.04 must say noble. Copying a sources.list from a blog post about an older release is the usual source of the mismatch.

2. Move an end-of-life Debian to the archive

When a Debian release stops being supported, deb.debian.org and security.debian.org delete its suite. The archive host keeps it, unsigned-expired, so both the host and the validity check must change:

bash
# /etc/apt/sources.list for a bullseye system after its support ended deb http://archive.debian.org/debian bullseye main contrib non-free deb http://archive.debian.org/debian-security bullseye-security main contrib non-free
bash
# /etc/apt/apt.conf.d/99archive Acquire::Check-Valid-Until "false";

Check-Valid-Until=false is appropriate only for an archive that no longer publishes updates; on a supported release it weakens replay protection, so keep it scoped to the file that needs it and remove it when the host is upgraded.

3. Ubuntu releases that moved to old-releases

Ubuntu moves unsupported releases out of the main mirrors. Rewriting the host keeps the rest of the file intact:

bash
sudo sed -i -E 's|https?://(archive|security)\.ubuntu\.com/ubuntu/?|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list sudo apt update

For a system that is still supported, do not do this — a 404 on archive.ubuntu.com for a current release usually means the mirror pool is temporarily out of sync, and apt update a few minutes later succeeds.

4. Third-party repositories that disappeared

PPAs and vendor repositories are removed or renamed far more often than distribution mirrors. The failing line names the URL, so find the file that added it and delete or update it:

bash
grep -rn "ppa.launchpadcontent.net" /etc/apt/sources.list.d/ sudo rm /etc/apt/sources.list.d/dead-ppa.list sudo apt update

Vendor repositories pinned to a codename also break after a system upgrade: NodeSource for bookworm on a trixie host, or Docker's focal repository on noble. Install the vendor's current instructions rather than editing the suite by hand, because the keyring usually changes with the suite.

5. Proxies and captive portals that return HTML

A proxy that intercepts HTTP can answer 200 with an HTML error page, and apt reports a signature or split error rather than a 404. Check the response body, not only the status:

curl -s http://deb.debian.org/debian/dists/bookworm/Release | head -3 # Origin: Debian <- real # <html><body>Blocked <- proxy

If a proxy is required, configure it in /etc/apt/apt.conf.d/95proxy with Acquire::http::Proxy "http://proxy:3128"; instead of relying on environment variables, which sudo does not always pass through.

6. The deb822 format and signed-by keys

Current Debian and Ubuntu releases read .sources files in the deb822 format, and mixing both formats for the same repository duplicates every package entry:

bash
# /etc/apt/sources.list.d/vendor.sources Types: deb URIs: https://packages.example.com/apt Suites: stable Components: main Signed-By: /etc/apt/keyrings/example.asc

Verify with apt-cache policy that each repository appears once, with the expected suite. A repository listed twice — once in sources.list and once in a .sources file — produces warnings about duplicate sources that look unrelated to this error but usually arrive together after a migration. Reading the resulting sources.list against the vendor's instructions is easier with the text diff tool, and checking which URL actually answers is a one-line job with the curl command generator.

Common Compilation/Runtime Mistakes & Version Gotchas

  • Adding [trusted=yes] to silence it. That disables signature checks for the repository and turns a missing file into an unverified install.
  • apt-key add. Deprecated since apt 1.4 and removed from newer images; keys belong in /etc/apt/keyrings with Signed-By.
  • Editing the wrong file. Both sources.list and sources.list.d/* are read; grep -rn finds the line that owns the failing URL.
  • Keeping Check-Valid-Until=false on a live system. It hides expired metadata for supported releases and weakens replay resistance.
  • Upgrading the distribution without updating third-party repos. Vendor repositories pinned to the old codename fail exactly like this after do-release-upgrade.
  • Version notes. Debian 12 and Ubuntu 24.04 default to the deb822 .sources format while sources.list still works; archive.debian.org carries every EOL suite but no security updates, so an archived host should be treated as offline-capable rather than patched.

Official documentation: sources.list(5) and apt-get(8).

Official references

primary documentation

The Linux documentation that defines the behaviour this guide explains.

Try matching browser tools

All tools

Small utilities that fit Linux work — they run entirely in this browser tab, so nothing you paste leaves your device.

All Linux guides

More in Linux

All Linux guides

The guides filed next to this one in Linux, in library order.