Docker packages cannot be found on Ubuntu 24.04
Asked by
zebra_finch_song
I'm running Ubuntu 24.04 LTS Server and following Docker's official Ubuntu installation instructions. When I try to install docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin, APT says the packages have no installation candidate or cannot be located. I already ran apt update, but the problem remains. The command output also appears to show the install command duplicated, with "sudo apt install" accidentally attached to the end of the docker-compose-plugin package name. What should I check or redo?
Answers
Make sure every command in the repository setup section was completed, especially adding Dockerโs GPG key and APT repository. Then run `sudo apt update` again before installing the packages. If the Docker repository was not added successfully, APT will not know where to find docker-ce or the Docker plugins.
Reply to this answer
The command shown in the error output is malformed and appears to be pasted twice: `docker-compose-pluginsudo apt install ...`. Run one clean command instead: `sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`. Also check that the repository entry points to the correct Ubuntu 24.04 codename, `noble`, and that `apt update` reports no repository errors.
once in a while: If the Docker repository is configured correctly but you still want a package from Ubuntuโs own repositories, the package name is usually `docker.io`, not `docker-ce`. However, donโt mix the Docker CE instructions with the Ubuntu-package installation unless you intentionally choose one method.
Reply to this answer
The package names themselves are valid for Dockerโs repository, so changing `docker-ce` to another name is not the main fix. Inspect the output of `apt update` and confirm that a Docker repository for Ubuntu 24.04 is listed without errors. A failed key import, incorrect distribution codename, or missing repository line will produce exactly these โno installation candidateโ messages.
Reply to this answer
Add your answer
Answers are reviewed before publication.
zebra_finch_song: I did run apt update, but Iโll verify that the repository and signing-key commands completed successfully rather than assuming the update alone was enough.