Ubuntu – Problems installing docker on 16.04: “Failed to start Docker Application Container Engine.”

16.04docker

Just tried to install docker on my Ubuntu 16.04, and I get the error below. Any suggestions what is wrong and how to fix it?

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 2017-07-28 12:39:11 CEST; 9ms ago
     Docs: https://docs.docker.com
  Process: 15533 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 15533 (code=exited, status=1/FAILURE)

Jul 28 12:39:11 jonas-X555LAB systemd[1]: Failed to start Docker Application Container Engine.
Jul 28 12:39:11 jonas-X555LAB systemd[1]: docker.service: Unit entered failed state.
Jul 28 12:39:11 jonas-X555LAB systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

I followed this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update

$ sudo apt-cache policy docker-ce
docker-ce:
  Installed: 17.06.0~ce-0~ubuntu
  Candidate: 17.06.0~ce-0~ubuntu
  Version table:
 *** 17.06.0~ce-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
        100 /var/lib/dpkg/status
     17.05.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.04.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/edge amd64 Packages
     17.03.2~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
     17.03.1~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
     17.03.0~ce-0~ubuntu-xenial 500
        500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages

$ sudo apt-get install -y docker-ce

On this same machine, I have a Linux Mint 17.3 installation on which docker worked just fine. Using same home directory as before on LM17.3.

Here are some specs:

$ inxi -fs
CPU:       Dual core Intel Core i3-4005U (-HT-MCP-) cache: 3072 KB 
           clock speeds: max: 1600 MHz 1: 799 MHz 2: 799 MHz 3: 799 MHz 4: 799 MHz
           CPU Flags: abm acpi aes aperfmperf apic arat arch_perfmon avx avx2 bmi1 bmi2 bts clflush cmov
           constant_tsc cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept erms est f16c flexpriority fma fpu fsgsbase
           fxsr ht invpcid lahf_lm lm mca mce mmx monitor movbe msr mtrr nonstop_tsc nopl nx pae pat pbe pcid
           pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pts rdrand rdtscp rep_good sdbg sep smep ss
           sse sse2 sse4_1 sse4_2 ssse3 syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi
           vpid xsave xsaveopt xtopology xtpr
Sensors:   System Temperatures: cpu: 40.5C mobo: N/A
           Fan Speeds (in rpm): cpu: 2800

Best Answer

Hi you might want to use journalctl to see exactly what is going wrong.

Use it like this:

# journalctl -u docker.service

To view logs and see what exactly went wrong.

Tip: use the --since flag to filter your search.

For more information on journalctl see this page.

Related Question