Installing Docker on buster - E: Package 'docker-ce' has no installation candidate

I am trying to install Docker on a completely fresh installation of Debian buster. I followed the instructions at Debian | Docker Docs which went fine up to:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

which produced the following output:

Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  docker-ce-cli:amd64

E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'

When I use apt search, it finds all three packages despite apt install saying it cannot. I saw here https://www.linode.com/docs/guides/how-to-install-docker-ce-on-debian-10/ that this error can be because the stable version of Docker isn’t available yet but following the instructions there (ie adding “edge test” to the end of the appropriate line in apt/sources.list.d/docker.list) made no difference whatever.

I ran # apt update before running # apt install both times with exactly the same result. I’ve been using apt for years and I cannot ever recall a situation where apt search found a package that apt install claimed had no installation candidate.

I would have thought this was a common error but I’m stuck here and an hour of fruitless Googling hasn’t helped. My Debian installation was absolutely brand new so it’s unlikely to be caused by anything else I’ve installed.

Does anyone know what I’m doing wrong?

1 Like

Did you remember to add the docker source which is mention here:

I did follow all those steps and adding the repo must have worked or apt search wouldn’t have found the packages.

I’ve just tried following the same instructions on a clean Debian VM and it worked. Consequently, it’s clear that the difference relates to the way the two Debian installations are configured. Both are fresh installs but the one that worked was a full desktop installation whereas the one that didn’t was a cut-down text only installation.

I’m going to start from scratch again only doing a full desktop installation and see whether that works.

if its not too late, what does:

echo $(lsb_release -cs) 

give?

It gives just “buster” which is what I expected.

Since I managed to get this working without any trouble in a Debian VM (also running 10.9) I assumed it must be because I installed the full GUI on the VM but only the CLI on the server and that there was some non-obvious package missing from the CLI installation. It turns out that this is incorrect so I’m even more baffled.

I completely reinstalled Debian (this is something I’ve done so many times I could do it in my sleep so it wasn’t a big deal) only with the full GUI. Unfortunately, precisely the same thing happened. This was a completely default clean installation and the only changes I had made were to install screen, mc and to add my user to the /etc/sudoers file.

I know that this is nothing to do with the packages being available because both the VM and the server are running the same version of Debian but the Docker packages installed without any problem on the VM.

I tried doing exactly the same thing on the server and on the VM. On the VM everything worked as expected. On the server it didn’t. I eventually tracked the issue down to the server having a default architecture of i386 not amd64 which is why packages were not being found.

Now I need to work out why the default architecture was wrong but that’s a Debian issue, not a Docker issue.

1 Like

I am answering my own question here in case anyone else makes the daft but difficult to diagnose mistake I did.

The problems I had were down to installing an i386 (ie 32 bit) rather than an amd64 (ie 64 bit) version of Debian and that was caused by my careless in downloading the wrong iso image. The installation works fine and during the attempt at installing Docker, no errors occur but when apt is looking for the packages, it was expecting [arch=i386] packages but the repo I installed only included [arch=amd64] packages and so apt reported no installation candidate.

Thank you for trying to help me fix my self-inflicted problem and I hope that this helps someone else in future.

2 Likes

Thank you so much! You aren’t the only careless one! :rofl: :sweat_smile:

1 Like

just helped me out as well! i386 image ISO on the debian VM. DOWP!~~~ thanks for your post

This error can happen when you miss the step:

  1. Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

From: Install Docker Engine on Debian | Docker Documentation

1 Like

I had a similar issue on Ubuntu 23.04 with kernel version 6.6. I removed Docker and all its dependencies. I then changed the kernel version to 6.2. After that, I followed the process outlined in the Install from a package section of the Docker documentation instead of using the command line command apt install. This worked fine for me.

thank you so muchhhhh. you make my day <3

I had the same problem
If you go here: Index of linux/ubuntu/dists/jammy/
then go to /pool/stable
then follow the process of downloading with a package in this guide https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

the problem should be solved

Here’s how I solved it;

The step 1 on the official website did not work well for me, so I replaced the instructions for adding gpg key and adding repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o  /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Remember

 sudo apt-get update

Work now

My environment:

leon@pc:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 22.04.3 LTS

Release: 22.04

Codename:       jammy
1 Like