Unable to install docker ubuntu 20.04

Issue Type: Unable to install Docker on Ubuntu 20.04

OS Version/build:

  • Description: Ubuntu 20.04.2 LTS
  • Release: 20.04
  • Codename: focal

App version:

  • Docker version 20.10.5, build 55c4c88

Steps to reproduce:
Merely followed the instructions from Docker documentation (Install Docker Engine on Ubuntu | Docker Documentation). When I run sudo apt-get install docker-ce docker-ce-cli containerd.io I receive the error below and docker does not ever start properly…

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 2021-04-10 13:15:01 CDT; 5ms ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 20246 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 20246 (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
dpkg: dependency problems prevent configuration of docker-ce-rootless-extras:
docker-ce-rootless-extras depends on docker-ce; however:
Package docker-ce is not configured yet.

dpkg: error processing package docker-ce-rootless-extras (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
docker-ce
docker-ce-rootless-extras
E: Sub-process /usr/bin/dpkg returned an error code (1)

I spent all day yesterday trying to get this to work and haven’t been able to figure it out, so any help would be greatly appreciated!! Let me know if there are any additional logs that would be helpful for troubleshooting!

Hi,

I have the same issue when i try to install docker.

Did you find a solution?

I had a VPN connection activated (ps aux | grep vpn), I stopped it : sudo systemctl openvpn stop

1 Like

Hey Delyriand!

I had stumbled into the VPN being a possible issue, but I had no VPN installed…

From this post I was able to move in the correct direction to get to a 75% resolution.

I found that problem laid in one of my kernel modules not loading in this case it was ip_tables. I was able to get it working by running sudo apt-get install --reinstall linux-modules-5.8.0-48-generic. This got Docker running, but after restarting the system it would go back to getting the same error and I would have to run that command again to get Docker running again.

If anyone knows how to get ip_tables permanently loaded as a kernel module… I believe that would resolve my issue and I would forever be in that persons debt! :wink:

@millerlm012 The top reply for the linked question actually tells you how to make module load on boot - this is the file you want to modify.
http://manpages.ubuntu.com/manpages/cosmic/man5/modules.5.html.

@kreha1 Thanks for the reply and sorry for the late response (been busy lol). I tried adding iptables to my /etc/modules to be loaded on boot, but that didn’t resolve the issue. I’ve identified that currently when I boot my machine, /lib/modules/5.8.0-59-generic seems to be missing files/directories that are added after performing that reinstall command from above. Do you know anything on how to reinstall that Linux Kernel permanently? I also posted this question in a more related community, so no worries if you don’t know. I understand this seems to be more of a Linux issue and not a Docker issue.

I was able to resolve this issue by completely reinstalling the OS (Ubuntu-Server).

Remove /var/lib/docker and try again. That was a solution for me.