2

I'm new using docker and linux and I tried to install docker on my new Ubuntu 20.04 LTS.

I was following these instructions: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

When I arrived at this command: sudo apt install docker-ce, I got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
docker-ce is already the newest version (5:19.03.9~3-0~ubuntu-focal).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up docker-ce (5:19.03.9~3-0~ubuntu-focal) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2020-05-23 22:00:38 CES
T; 8ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 15674 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containe
rd.sock (code=exited, status=1/FAILURE)
   Main PID: 15674 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 
1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can someone help me to resolve this ?

For learning purposes, I would like to know what is going wrong and why. But isn't mandatory as long as this works again.

Thank you very much.

3 Answers 3

5

I had some similar errors that were a result of my VPN interfering with docker creating network interfaces. Turning off my VPN made it work.

1

I experienced similar issue before.

You may execute following command and see what error it reports.

/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

For my case, the new update does not like my /etc/docker/daemon.json and complaints one configuration. It works after remove the file.

2
  • Thank you for your help. I just did and it seems that docker now works perfectly. After using your command, I didn't had any errors in the log and I tried and succeed to install docker correctly. I posted an answer to explain what happened.
    – Bravo2bad
    Jun 4, 2020 at 23:56
  • I have same problem, and command returned me "dockerd needs to be started with root. To see how to run dockerd in rootless mode with unprivileged user, see the documentation". Seems that docker need root even on install phase, but not only after installation. But install command follows with sudo
    – Oleksiy
    Aug 19, 2020 at 7:46
0

I tried again after two weeks and it now works perfectly.

I don't really know why (I would like to) but I migrated to Ubuntu 20.04 (from 18.04) just a one month after its release.

Maybe too soon for the docker installation packages to be ready for the Focal distribution.

Now that they are, it probably was solved after I did a sudo apt update (which I do frequently).

But again, this is what I think. I don't know if this is the correct answer. However I will mark this post as solved, but feel free to share your answer if you know what really happened.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.