Unable to locate package `docker-ce` on a 64bit ubuntu
Solution 1
Ubuntu 22.04 (Jammy)
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 jammy stable"
Ubuntu 21.10 (Impish)
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 impish stable"
Ubuntu 21.04 (hirsute)
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 hirsute stable"
Ubuntu 20.10 (Groovy)
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 groovy stable"
Ubuntu 20.04 (Focal)
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 focal stable"
Ubuntu 19.10 (Eoan)
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 eoan stable"
Ubuntu 19.04 (Disco)
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 disco stable"
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 cosmic test"
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"
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"
Ubuntu 16.04
You can install docker-ce
on Ubuntu 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"
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
:
For Ubuntu 16.04 you need to run sudo apt update
. For Ubuntu 18.04 and higher, add-apt-repository
will execute apt update
automatically:
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/
trusty/
xenial/
yakkety/
zesty/
Docker , OS requirements
Solution 2
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
Solution 3
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
Solution 4
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.
Related videos on Youtube
danidemi
Java developer and architect in a wide variety of web based applications: banks, telco, tourism, mobile. Always interested in design and architecture issues, I have a strong interest in applying agile methodologies and open source framework. Specialties: Java, Spring, Hibernate.
Updated on September 18, 2022Comments
-
danidemi over 1 year
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
-
jordanm about 7 yearsDid you run
apt-get update
after adding the repo? -
danidemi over 6 years@jordanm yes, sorry I didn't post it in the question.
-
-
dashesy almost 7 yearswhy is it not in the official repositories?
-
progfan over 6 yearsIt'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"
-
Michael Wiles over 6 yearsstill not in artful repository :(
-
Thufir over 6 yearsdocker not being in zesty -- but why not snap? isn't the point of snap to install packages like this?
-
Thufir over 6 years@GAD3R that's a good answer. perhaps bull-headed of me, want to install with snap -- if do-able. (I mean, it installs, but then...etc. something about apparmor.) I'll come back and try this at some point -- I'm sure it works :)
-
Hieu over 6 years@MichaelWiles please see my answer for Ubuntu 17.10 (artful): unix.stackexchange.com/a/406952/102003
-
CivFan about 6 yearsThe 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 theartful
repo? -
HydTechie about 6 yearswhen asked for version docker version, it gave hint to use $sudo apt install docker.io.. that ran successfully.
-
Doogle about 6 yearsIndeed for 18.04 bionic docker repo from test fixed the issue sudo apt-get install docker-ce Reading package lists... Done Building dependency tree Reading state information... Done Package docker-ce is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'docker-ce' has no installation candidate Fix: sudo add-apt-repository "deb [arch=amd64] download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ test" sudo apt-get update Install docker
-
Skaparate over 5 years@HydTechie, The docs says that the old docker versions should be uninstalled, docker.io being one of the older versions: docs.docker.com/install/linux/docker-ce/ubuntu/…
-
Anish about 5 yearsI would recommend putting your updated answers on top and not at the bottom. I ran the outdated answer before seeing the updated answer.
-
pwaterz about 5 yearsFYI for 19.04 'disco' repo does not have docker-ce, you have to use bionic until it gets added.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
-
Pedro Costa about 5 yearsyup, same here today with
disco
have to usebionic
packages instead. -
Gayan almost 5 yearsFor ubuntu 19.04 I found @pwaterz comment useful, which only
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
worked. Note bionic -
Andrew about 4 yearsFor Ubuntu 18.04 (Bionic), I had to do:
sudo apt install docker-containerd docker-doc docker-runc docker.io
(still having problems running hello-world, but...) -
Pathros almost 3 yearsWorked well for Ubuntu 20.04.2:
$ 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 focal stable" && sudo apt install -y uidmap
-
Slava Fomin II over 2 yearsWhat about 21.10 (impish)? :)
-
Slava Fomin II over 2 years@GAD3R Great 👍
-
Daniel over 2 yearsDoesn't work on impish (
E: Unable to locate package docker-ce
). Had to revert/etc/apt/sources.list.d/docker.list
tohirsute
.