apt update: the Docker repository does not have a Release file on Ubuntu
The repository does not have a Release file.Short answer
apt looks for a folder named after your release codename in Docker's repository. If Docker has no folder for that codename, you get the Release file error. Use the Ubuntu base codename instead of the derivative's, and make sure your Ubuntu version is one Docker supports.
Fix it fast
1Find out which cause you have
Print the codename your system reports and the suite written in the Docker source file.
. /etc/os-release && echo "VERSION_CODENAME=$VERSION_CODENAME UBUNTU_CODENAME=$UBUNTU_CODENAME" cat /etc/apt/sources.list.d/docker.sources2Match what you see, then jump to its fix
What does the error look like?
The repository does not have a Release file.
Cause 1 of 2
A derivative distribution reports its own codename
1Check
Docker's install steps take the suite from UBUNTU_CODENAME if it is set, and otherwise from VERSION_CODENAME. Derivatives such as Linux Mint are not officially supported, and the page only says they may work.
grep -n "Suites" /etc/apt/sources.list.d/docker.sources2Fix
Set Suites to your Ubuntu base codename, using the same expression as the Docker steps, then refresh the package list.
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update3Verify
apt update finishes without the Release file error for download.docker.com.
sudo apt update 2>&1 | grep -i dockerConfirmed by docs.docker.com
Cause 2 of 2
The Ubuntu release is not one Docker supports
1Check
Docker lists the 64-bit Ubuntu versions it supports on its install page: 26.10, 26.04 LTS, 24.04 LTS and 22.04 LTS.
lsb_release -a2Fix
Move to a supported Ubuntu release, then repeat the repository setup. Remove the Docker source until then so it stops breaking apt update.
sudo rm /etc/apt/sources.list.d/docker.sources
sudo apt update3Verify
apt update no longer reports an error.
sudo apt updateConfirmed by docs.docker.com
How do I stop it coming back?
- Write the Suites line with the UBUNTU_CODENAME fallback, never a hard-coded name.
- Check Docker's supported-version list before upgrading Ubuntu to an interim release.
- Keep the Docker source in its own file so it can be removed cleanly.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fixServers
A dev container port does not open in the browser when Docker runs on a remote host
If your application only accepts calls from localhost, it will reject connections from published ports
Three things usually break it: the app listens only on localhost inside the container, so published ports are rejected; you open the container port instead of the mapped localhost port VS Code shows; or you changed appPort or a Compose ports list and did not rebuild.
3 causes, each with a fix