Docker Desktop doesn't install saying docker-ce-cli not installable
Asked Answered
B

10

110

In an online training course, the instructor mentioned that he has "an Ubuntu virtual machine installed with Docker Desktop"; therefore, I am trying to install the same on a Windows 10 physical host following the instructions on the official website.

However, the apt-get install didn't work, and the error message was docker-desktop : Depends: docker-ce-cli but it is not installable. I am wondering whether I missed anything here.

We highly appreciate any hints or suggestions. Just let me know if you need more details.

Screenshot:

root@dockeru:/home/work/Downloads# ls
docker-desktop-4.8.1-amd64.deb
root@dockeru:/home/work/Downloads# apt-get install ./docker-desktop-4.8.1-amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'docker-desktop' instead of './docker-desktop-4.8.1-amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 docker-desktop : Depends: docker-ce-cli but it is not installable
E: Unable to correct problems, you have held broken packages.
Bundesrat answered 19/5, 2022 at 6:12 Comment(1)
It's 2024, and that error is still raising, using rigorously the install process given on the website. In other words, this trend is plain rubbish and it's just about loosing your time. Solution may be found here: youtube.com/watch?v=PivpCKEiQOQByrn
F
285

You don't need to install Docker Engine alongside Docker Desktop unless you really need it. Docker's documentation clearly states:

Docker Desktop for Linux and Docker Engine can be installed side-by-side on the same machine. Using a dedicated storage location for Docker Desktop prevents it from interfering with a Docker Engine installation on the same machine. While it’s possible to run both Docker Desktop and Docker Engine simultaneously, there may be situations where running both at the same time can cause issues.

The issue you are facing is due to the missing Docker repository on your system, which you can resolve by following a part of Docker Engine's documentation as follows:

sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update -y

After that, you can go on with the installation of Docker Desktop:

sudo apt install ./docker-desktop-<version>-<arch>.deb

P.S. Don't get panic if you see the error below at the end of the installation process. Just ignore it and you'll be fine ;)

Download is performed unsandboxed as root as file docker-desktop-
<version>-<arch>.deb couldn't be accessed by user '_apt'. - 
pkgAcquire::Run (13: Permission denied)

Update: Thankfully, the Docker team has modified their documentation accordingly.

Franckot answered 23/8, 2022 at 8:27 Comment(10)
This is the best answer from my point of view. For me repeating the stuff for docker engine did the trick.Iggie
Trying this in Linux MInt 21.0 I got the following error:- E: The repository 'https://download.docker.com/linux/ubuntu vanessa Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. The search continues :(Exemption
@Exemption It differs per distro, but in your case, I believe you should store the GPG key into /usr/share/keyrings/docker.gpg instead of /etc/apt/keyrings/docker.gpg. You can also bypass the safeguard by using --allow-unauthenticated flag, or you can add [trusted=yes] option for the problematic source in the docker.list file.Franckot
@Franckot Thanks but it didn't work. Still get "The following packages have unmet dependencies. docker-desktop : Depends: docker-ce-cli but it is not installable E: Unable to correct problems, you have held broken packages."Exemption
@Exemption it's strange since your distro is based on Ubuntu. Have you tried installing it using Snap?Franckot
@Exemption Also give this a try instead of the one above: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable"Franckot
@Exemption replace $(lsb_release -cs) by "jammy" which is ubuntu distro venessa is based on. i.e echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullHg
@Franckot I get e depsolve problem on docker-ce-cli not being installed. I guess you still need bothFleeman
Worked for me like a charm with Ubuntu 22.04 Jammy. Thanks!Engine
I was missing apt-update.Harlanharland
P
20

Don't forget to sudo apt-get update after setting up the repository: https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository

Pasta answered 6/8, 2022 at 16:5 Comment(0)
B
14

You first need to install the docker engine. Official Docker Engine link Then you can follow the docker desktop guide. I think this is caused because docker desktop can't install without some dependencies that install with docker engine.

Bastogne answered 27/5, 2022 at 22:51 Comment(2)
Why does Docker Desktop documentation say it recommends installing either Docker Desktop or Docker Engine and not both? This makes no sense.Claudicant
Why does docker-desktop not install these dependencies itself?Seaquake
C
4

I am using Ubuntu (specifically Zorin OS) and ran into the same issue while installing. However, I've solved mine by following the Setup repository part of Install Docker Engine documentation, and after that, running the sudo apt-get install ./docker-desktop-<version>-<arch>.deb to install the .deb file again. And it worked.

How this works? Because apt will try to automatically install any required dependencies that are not installed/unmet. It tried to do it in this case, however, it doesn't know docker-ce-cli because it's not in the default apt repository or in any other apt repository it currently uses. But by successfully adding the Docker repository to apt by following the steps in the Install Docker Engine documentation, it can now see and knows the docker-ce-cli package. And when you run the sudo apt install on the docker desktop deb package, it will now automatically install the docker-ce-cli along with other required dependencies.

Carpus answered 18/7, 2022 at 1:48 Comment(1)
Yes I ran into same problem on zorin, I followed the docs.docker.com/engine/install/ubuntu/… and then re-ran the commands and it worked fine. Thanks!Lsd
B
4

To solve this issue I taped the commands below in this order

sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update -y
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

At the end I did

sudo docker run hello-world

And you will see this :

Hello from Docker!
This message shows that your installation appears to be working correctly.

I hope that will help you I finalized the process and double-click on the file docker-desktop-4.15.0-amd64.deb to run the process Best regards

Butter answered 5/12, 2022 at 18:32 Comment(0)
H
1

If you read carefully this link: https://docs.docker.com/desktop/install/ubuntu/#install-docker-desktop It says that you have to add the apt repository first. I had the same issue and solved by adding this: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

Halflight answered 29/10, 2023 at 15:50 Comment(1)
Indeed, that solution worked for me (Ubuntu 22.04 LTS). Thanks! 1) Docker was already installed with APT and running fine 2) Following step-by-step guide you mention without trouble : some kind of problems (service docker stopped among others) but all was ok after manually restarting docker service 3) docker-desktop-4.28.0-amd64.deb install (with the little error at the end like mentioned in step step-by-step guide of Docker) => Docker Desktop runs fineDote
D
0

Thanks for this. I as well had the same problem and had to search for a solution. The Mac OSX and Windows installers all come as a single package, but the Linux one does require the Docker engine to be installed first.

The Docker Desktop for Linux should detect that the engine isn't installed and give you a more useful error than

docker-desktop : Depends: docker-ce-cli but it is not installable

But if it did that then how would the Linux community keep the riff-raff out? Yep. Linux is not for the faint of heart, or those who fear the command line.

Drumbeat answered 14/7, 2022 at 23:33 Comment(0)
M
0

FOR THOSE WHO ARE USING UBUNTU BASED DISTROS

Follow the steps of the doc: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

  • i suggest you to clean up first by for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
  • In the third step, CHANGE the "$VERSION_CODENAME" to "$UBUNTU_CODENAME".
  • Don´t forget to sudo apt-get update.
Mesopause answered 9/6, 2023 at 1:8 Comment(0)
T
0

install Docker CE

sudo apt-get update && apt-get install -y docker.io

verify docker installation

docker -v
Tartarean answered 21/3, 2024 at 6:7 Comment(0)
C
0

Simply using apt in place of apt-get worked for me

https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

Cas answered 29/3, 2024 at 14:39 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.