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.

Introduction & Quick Summary
apt update ends with a line that stops the whole upgrade path:
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:
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 pointsFor a Debian release that is out of support, the fix is the archive host rather than the normal mirror:
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 updateFor 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 OKThe 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 theNO_PUBKEYerror, which is a key problem, not a missing file.Release file ... is expired— the file exists but itsValid-Untildate has passed; that is the archive case and is fixed withCheck-Valid-Until=falseor a different mirror.
A reproduction with a wrong suite name makes the failure obvious:
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.listKey Comparison Table
| Message fragment | Meaning | Fix |
|---|---|---|
does not have a Release file | URL returns 404 | correct the suite or move to the archive |
Release file ... is expired | Valid-Until passed | archive host plus Check-Valid-Until=false |
NO_PUBKEY | signing key missing | install the key into keyrings |
403 Forbidden on Release | mirror blocks the agent or country | switch mirror or use a proxy |
Clearsigned file isn't valid, got 'NOSPLIT' | server returned HTML | fix the proxy or URL |
Unable to locate package | index never loaded | resolve the repository error first |
| Release | Status | Archive base URL |
|---|---|---|
| Debian 11 bullseye | LTS ended 2026 | http://archive.debian.org/debian |
| Debian 12 bookworm | supported | http://deb.debian.org/debian |
| Debian 13 trixie | supported | http://deb.debian.org/debian |
| Ubuntu 20.04 focal | supported until 2030 (ESM) | normal mirrors |
| Ubuntu 18.04 bionic | standard support ended | http://old-releases.ubuntu.com/ubuntu |
| Ubuntu 16.04 xenial | standard support ended | http://old-releases.ubuntu.com/ubuntu |
| Check | Command | What it proves |
|---|---|---|
| suite name | lsb_release -cs | what apt expects in the URL |
| repository URLs | apt-cache policy | which hosts and suites are configured |
| raw HTTP status | curl -sI <url>/dists/<suite>/Release | whether the file exists |
| which file defines it | grep -r "" /etc/apt/sources.list.d/ | where to edit |
| key state | apt-key list (deprecated) or ls /etc/apt/keyrings | whether 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:
. /etc/os-release && echo "$VERSION_CODENAME"
grep -RhE "^deb|^URIs" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/nullDebian 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:
# /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# /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:
sudo sed -i -E 's|https?://(archive|security)\.ubuntu\.com/ubuntu/?|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
sudo apt updateFor 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:
grep -rn "ppa.launchpadcontent.net" /etc/apt/sources.list.d/
sudo rm /etc/apt/sources.list.d/dead-ppa.list
sudo apt updateVendor 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 <- proxyIf 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:
# /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.ascVerify 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/keyringswithSigned-By.- Editing the wrong file. Both
sources.listandsources.list.d/*are read;grep -rnfinds the line that owns the failing URL. - Keeping
Check-Valid-Until=falseon 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
.sourcesformat whilesources.liststill works;archive.debian.orgcarries 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 documentationThe Linux documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Linux work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Linux guides
All Linux guidesnginx 502 Bad Gateway: upstream connection refused
The log line names the address and errno, which is the diagnosis. Fix the host, the start-up order, the buffers, or the timeout that actually fired.
Linux: Read-only file system (EROFS) on a mounted volume
EROFS is a mount condition, not a permission error. Read the kernel log first: I/O errors, a full thin pool, an ro fstab entry or a read-only root.
Linux Networking Diagnostics: ss, ip, dig, curl, and TCP Troubleshooting
A layer-by-layer path from interface to TLS that localises a failure in five commands, with the socket states and curl timings that identify each cause.
Linux: bind: Cannot assign requested address
EADDRNOTAVAIL means the kernel had no address to bind: too many TIME_WAIT sockets, an IP missing from the interface, or a wrong listen address.
More in Linux
All Linux guidesThe guides filed next to this one in Linux, in library order.