Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

apt update: the Docker repository does not have a Release file on Ubuntu

ErrorThe 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.

  • Applies to Ubuntu 24.04, Ubuntu 22.04, Linux Mint 22, apt 2.7
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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.sources
  2. 2Match what you see, then jump to its fix

    1. 1VERSION_CODENAME is not an Ubuntu name (for example a Linux Mint name) and UBUNTU_CODENAME isA derivative distribution reports its own codenameFix
    2. 2The codename is a real Ubuntu name, but not in Docker's supported listThe Ubuntu release is not one Docker supportsFix

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.sources

2Fix

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 update

3Verify

apt update finishes without the Release file error for download.docker.com.

sudo apt update 2>&1 | grep -i docker

Confirmed by docs.docker.com

Did this fix it?

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 -a

2Fix

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 update

3Verify

apt update no longer reports an error.

sudo apt update

Confirmed by docs.docker.com

Did this fix it?

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

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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.