Docker Community Forums

Share and learn in the Docker community.

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 Install Docker Engine on Debian | Docker Documentation 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 How to Install Docker CE on Debian 10 | Linode 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?

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.

This post was flagged by the community and is temporarily hidden.

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.

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.