Unable to locate package `docker-ce` on a 64bit ubuntu

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
Asked By: danidemi

||

Add Docker’s official GPG key:

sudo apt update
sudo apt install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Ubuntu 23.10 (Mantic Minotaur)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu mantic stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 23.04 (Lunar Lobster)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu lunar stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 22.10 (Kinetic)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu kinetic stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 22.04 (Jammy)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 21.10 (Impish)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu impish stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 21.04 (hirsute)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu hirsute stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 20.10 (Groovy)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu groovy stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 20.04 (Focal)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 19.10 (Eoan)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu eoan stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 19.04 (Disco)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu disco stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 18.10 (Cosmic)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu cosmic stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 18.04 (bionic)

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu bionic stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 17.10

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu artful stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Ubuntu 16.04

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu xenial stable" | 
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Run the following:

sudo apt update
apt-cache search docker-ce

sample output:

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

Install docker-ce:

sudo apt install docker-ce

To check the available and permitted Ubuntu codenames:

curl -sSL  https://download.docker.com/linux/ubuntu/dists/ |awk -F'"' 'FNR >7 {print $2}'

sample output (Results may be different after the directory updates):

../
artful/
bionic/
cosmic/
disco/
eoan/
focal/
groovy/
hirsute/
impish/
jammy/
kinetic/
lunar/
trusty/
xenial/
yakkety/
zesty/

Docker , OS requirements

Answered By: GAD3R

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.

Answered By: kubacech

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
Answered By: Hieu

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
Answered By: ENDEESA

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.

Answered By: Johan