Did you update the packages first?
sudo apt-get update
I recommend uninstalling and using the simple get.docker.com
script.
Does all of the "hard work for you.
Uninstall Docker CE
sudo apt-get remove docker-ce docker-ce-cli -y
Install curl
which curl &> /dev/null || (sudo apt-get update -qq && sudo apt-get install curl -y)
Install docker
curl --silent -SL https://get.docker.com/ | sh
Example
Install curl if itβs not already installed.
π³ gforghetti@server:[~] $ which curl &> /dev/null || (sudo apt-get update -qq && sudo apt-get install curl -y)
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
containerd.io libltdl7
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
curl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/159 kB of archives.
After this operation, 395 kB of additional disk space will be used.
Selecting previously unselected package curl.
(Reading database ... 89499 files and directories currently installed.)
Preparing to unpack .../curl_7.58.0-2ubuntu3.6_amd64.deb ...
Unpacking curl (7.58.0-2ubuntu3.6) ...
Setting up curl (7.58.0-2ubuntu3.6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Install Docker CE
π³ gforghetti@server:[~] $ curl --silent -SL https://get.docker.com/ | sh
# Executing docker install script, commit: 40b1b76
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sudo -E sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic edge" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
+ sudo -E sh -c docker version
Client:
Version: 18.09.2
API version: 1.39
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:47 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 03:42:13 2019
OS/Arch: linux/amd64
Experimental: false
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker gforghetti
Remember that you will have to log out and back in for this to take effect!
WARNING: Adding a user to the "docker" group will grant the ability to run
containers which can be used to obtain root privileges on the
docker host.
Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
for more information.
** DOCKER ENGINE - ENTERPRISE **
Test drive additional security features by activating Docker Engine - Enterprise.
* Leverage FIPS 140-2 validated encryption
* Run only trusted images with digital signature enforcement
** Learn more at https://dockr.ly/engine1 **
ACTIVATE your own engine to Docker Engine - Enterprise using:
sudo docker engine activate
Logout and then log back in so the group setting takes affect.
π³ gforghetti@server:[~] $ sudo usermod -aG docker gforghetti
π³ gforghetti@server:[~] $ exit
logout
$ sudo su - gforghetti
π³ gforghetti@server:[~] $ docker version
Client:
Version: 18.09.2
API version: 1.39
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:47 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 03:42:13 2019
OS/Arch: linux/amd64
Experimental: false
π³ gforghetti@server:[~] $