Docker Community Forums

Share and learn in the Docker community.

Error during install to Ubuntu 18.04

I try to install Docker to Ubuntu 18.04.

I use this guide: https://docs.docker.com/install/linux/docker-ce/ubuntu/

At the first time, I passed all steps and got error on last, attempting to install docker-ce:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

than, installation crushed with error. After that, I tried to install docker once more from the first step:

$ sudo apt-get remove docker docker-engine docker.io containerd runc

and got this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'docker-engine' is not installed, so not removed
Package 'containerd' is not installed, so not removed
Package 'docker' is not installed, so not removed
Package 'docker.io' is not installed, so not removed
Package 'runc' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up docker-ce (5:18.09.5~3-0~ubuntu-bionic) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
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 Fri 2019-04-12 13:52:26 MSK; 11ms ago
     Docs: https://docs.docker.com
  Process: 1884 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 1884 (code=exited, status=1/FAILURE)

Apr 12 13:52:26 n0ykp.vps.myjino.ru systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 12 13:52:26 n0ykp.vps.myjino.ru systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 12 13:52:26 n0ykp.vps.myjino.ru systemd[1]: Failed to start Docker Application Container Engine.
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)

Please help me to solve problem and install docker.

After

apt purge docker docker-ce docker-engine docker.io containerd runc

:

root@ovz1:~# dpkg -i /home/xpendence/downloads/docker-ce_18.09.5_3-0_ubuntu-bionic_amd64.deb 
Selecting previously unselected package docker-ce.
(Reading database ... 33991 files and directories currently installed.)
Preparing to unpack .../docker-ce_18.09.5_3-0_ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:18.09.5~3-0~ubuntu-bionic) ...
Setting up docker-ce (5:18.09.5~3-0~ubuntu-bionic) ...
update-alternatives: using /usr/bin/dockerd-ce to provide /usr/bin/dockerd (dockerd) in auto mode
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
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 Fri 2019-04-12 15:27:23 MSK; 11ms ago
     Docs: https://docs.docker.com
  Process: 3938 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 3938 (code=exited, status=1/FAILURE)

Apr 12 15:27:23 n0ykp.vps.myjino.ru systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 12 15:27:23 n0ykp.vps.myjino.ru systemd[1]: Failed to start Docker Application Container Engine.
dpkg: error processing package docker-ce (--install):
 installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (237-3ubuntu10.11) ...
Errors were encountered while processing:
 docker-ce