Can't install docker on Ubuntu 20.04

OS Version:

NAME="Ubuntu"

VERSION="20.04 LTS (Focal Fossa)"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu 20.04 LTS"

VERSION_ID="20.04"

HOME_URL="https://www.ubuntu.com/"

SUPPORT_URL="https://help.ubuntu.com/"

BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

VERSION_CODENAME=focal

UBUNTU_CODENAME=focal

I am installing UNMS in that runs in the docker container per this: https://help.ui.com/hc/en-us/articles/360000119728

Here is the error:

E: The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file.

This error seems to be docker related, as this URL Index of linux/ubuntu/dists/

does not contain focal.

is there a way to fix it?

1 Like

I think the reason is there is not a folder under https://download.docker.com/linux/ubuntu/dists name ‘focal’.
Just need to wait docker team create this ‘focal’ folder after they pass all test, I guess.

I haven’t upgraded to 20 yet, but this happened to me with several packages in early days of earlier releases. They just haven’t officially released a focal version yet.

This is untested but you can try using their package for ubuntu 19.10 by manually changing your apt sources, its always worked for me before with docker and others, he repo gpg keys should be the same.

Open apt sources list in a text editor, like nano:
sudo nano /etc/apt/sources.list

(It might be in /etc/apt/sources.list.d/docker.list or something, depending how it was installed)

Scroll to the bottom and look for the lines:
deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

Comment out that first line with a # at the beginning, then copy the same line right below it, except switching out the ubuntu codename focal for eoan.
It should end up looking like:
# deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

Ctrl+o to save, y to confirm filename, ctrl+x to close.

Then refresh your apt packages and try installing docker again :
sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io

Like i said, i havent tested this yet for focal, but its always worked for me before.

When a 20.04 package is released, just go back in to that same file and remove the # from the line with focal, and comment out or just delete the line with eoan, then sudo apt update && sudo apt full-upgrade

3 Likes

Worked for me. Thank you.

Any idea when we could expect it past a default of “when it’s ready”. Just a rough “end of month/next month/2021” would be good to know as to if I should wait for it for a deployment or look at something else.

It is fixed now. Make sure you use ubuntu repos and not debian.

Thanks, works perfectly. :sweat_smile:

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

Hi, I have had the same issue with Ubuntu 21.10 (Impish Indri), because it is very new.

I used this guide, but it failed when trying to run sudo apt-get update.

I did the change suggested by salem.aziel .

In /etc/apt/sources.list.d/docker.list I changed impish to hirsute to install the version for Ubuntu 21.04 (Hirsute Hippo).

Installation did run successfully now. Thanks!

Regards,
Florian

Perfect!!!
this helped me a lot

I had this problem, and I just used this:

sudo snap install docker

And run this:
docker -v

Docker version 20.10.17, build 100c70180f

Easy peasy!!! :slight_smile:

1 Like

The docker snap version proven itself to be not always compliant to vanilla docker behavior.
I strongly recommend installing the Docker Engine(!) from docker’s repos instead! Instructions: Docker Engine installation overview | Docker Documentation.

2 Likes

you are a genius, thanks.

You can find the description of the snap package here: Install docker on Linux | Snap Store. Make sure you understand the implications of what is written there. If you have issues with the snap package, the place to address them is Issues · docker-snap/docker-snap · GitHub.

I found out this was a whitespace problem, directly from the docker docs or any other docs you used. See below:

# success, single whitespace '.../linux/ubuntu $codename'
echo "deb [arch=$(dpkg --print-architecture) \
  signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# error, double whitespace '.../linux/ubuntu  $codename'
echo "deb [arch=$(dpkg --print-architecture) \
  signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable"