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

sudo apt-get install docker


Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
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 1


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?

  • 4
    docker.io is Docker package in APT!
    – N0rbert
    Commented Dec 5, 2020 at 7:02
  • @N0rbert Though Ubuntu's official repository contains docker as docker.io, docker's official documentation states, "Older versions of Docker were called docker, docker.io, or docker-engine". And the very first step is to remove them. ¯\_(ツ)_/¯ Anyway with Docker's repository you can have latest version in Xenial Xerus which is not the case with docker.io.
    – Kulfy
    Commented Dec 5, 2020 at 7:28
  • Agree that docker name confuses the user. But docker.io is working normally when installed :)
    – N0rbert
    Commented Dec 5, 2020 at 7:41
  • If it is not the real docker how it can pull images, and run them? I just installed the docker via snap sudo snap install docker and it can run hello-world docker run hello-world
    – AVarf
    Commented Apr 7, 2022 at 9:38
  • 1
    @AVarf APT installs deb packages. Snaps and debs differ functionally. See snapcraft.io/blog/a-technical-comparison-between-snaps-and-debs. For service not found issue, on a quick Google search, I found this askubuntu.com/q/977961
    – Kulfy
    Commented Apr 7, 2022 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .