I'm trying to install Docker on a Ubuntu 64 machine following the official installation guide.

Sadly Ubuntu seems it is not able to locate the docker-ce package. Any idea to fix it or at least to track what is happening ?

Here some details for you...

$ uname --all; sudo grep docker /etc/apt/sources.list; sudo apt-get install docker-ce

Linux ubuntu 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce
  • Did you run apt-get update after adding the repo? – jordanm May 4 '17 at 14:54
  • @jordanm yes, sorry I didn't post it in the question. – danidemi Nov 22 '17 at 15:28
up vote 149 down vote accepted

You can install docker-ce on Ubuntu 16.04 as follows:

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
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 xenial stable"
sudo apt-get update

Run the following

apt-cache search docker-ce

sample output:

docker-ce - Docker: the open-source application container engine

Install docker-ce:

sudo apt-get install docker-ce

Update Jan 03 2018

installing docker-ce on Ubuntu 17.10 :

docker-ce package is available on the official docker (Ubutu Artful) repository , to install it use the following commands :

sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 artful stable"
sudo apt update
sudo apt install docker-ce

Update Apr 29 2018 : Installing docker-ce on Ubuntu 18.04 (bionic)

sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 bionic stable"
sudo apt update
sudo apt install docker-ce

Update Oct 19 , 2018 Installing docker-ce on Ubuntu 18.10 (Cosmic)

sudo apt install apt-transport-https ca-certificates curl software-properties-common
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 bionic test"
sudo apt install docker-ce

The above command will install the latest testing release available on the pool/test/amd64/

  • 1
    Thx, fixed my problem. Can you please update your answer ? You mispelled the apt-cache command. I tried by myself but as you probably know edits should be at least 6 chars and here is just one! – danidemi May 4 '17 at 15:04
  • 4
  • 2
    It's worth mentioning that for Ubuntu 17.10, the step 3 would be: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable" – progfan Nov 4 '17 at 3:58
  • 3
    still not in artful repository :( – Michael Wiles Nov 17 '17 at 9:18
  • 4
    The instructions for 17.10 also worked for me in 18.04, when the official docker-ce install instructions did not. Maybe not recommended though, since it's from the artful repo? – CivFan Apr 27 at 22:53

For anyone who is using Ubuntu 17.10 (artful) and having this problem:

From https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:

Artful 17.10 (Docker CE 17.11 Edge only)

Zesty 17.04

Xenial 16.04

(LTS) Trusty 14.04 (LTS)

and:

To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands

So if you are using Ubuntu 17.10 (artful), you need to add this:

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable edge"

Noticing "edge" word is added. If you already ran this command before without "edge". You can edit the source.list file at /etc/apt/sources.list. After that, refresh and install docker-ce as usual:

sudo apt-get update
sudo apt-get install docker-ce

Looks like docker will be in official repository after December docker-ce release (stable). Then this repository:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"

should work. Meanwhile there should be soon available edge release on

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful edge"

But its not available now yet. But v17.11.0-ce-rc4 was released yesterday, so i would expect it any day now.

So for now I used package from 17.04 repo as GAD3R is suggesting.

link to github issue.

Try using:

$ 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 install docker.io
  • when asked for version docker version, it gave hint to use $sudo apt install docker.io.. that ran successfully. – HydTechie May 12 at 17:02

None of the above worked for me.

I removed docker completely, then went and manually removed the docker files in /var.

Reinstalled and running perfectly afterwards.

protected by GAD3R Apr 30 at 21:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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