Installing docker with snap and apt-get

I'm trying to install docker on my Ubuntu 20.04. Trying install docker with apt-get and snap:

sudo apt-get install docker

Output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed: wmdocker
The following NEW packages will be installed: docker wmdocker
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/14.3 kB of archives.
After this operation, 58.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package wmdocker.
(Reading database ... 193518 files and directories currently installed.)
Preparing to unpack .../wmdocker_1.5-2_amd64.deb ...
Unpacking wmdocker (1.5-2) ...
Selecting previously unselected package docker.
Preparing to unpack .../archives/docker_1.5-2_all.deb ...
Unpacking docker (1.5-2) ...
Setting up wmdocker (1.5-2) ...
Setting up docker (1.5-2) ...
Processing triggers for man-db (2.9.1-1) ...

If I run docker command I get error:

a@ubuntu:~$ docker
Command 'docker' not found, but can be installed with:
sudo snap install docker # version 19.03.11, or
sudo apt install docker.io # version 19.03.8-0ubuntu1.20.04.1
See 'snap info docker' for additional versions.

Why system can't find docker command?

Then I tied snap:

sudo snap install docker 

And docker command run fine.

Why I can install docker with snap and can't with apt-get ?

1 Answer

Because that docker is not the docker you expected. docker is the package name of system tray for KDE3/GNOME2. You can verify that by visiting Ubuntu package search or by running

apt show docker

The error message you got while running docker from terminal gives a brief idea about this confusion.

To install the docker you expected, refer to official documentation or see How to install docker community on Ubuntu 20.04 LTS?

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like