28

I am following the docker installation on Ubuntu 20.04 using https://docs.docker.com/engine/install/ubuntu/ in Ubuntu VM on VMware.

But when running the command to add the repository to Ubuntu.

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

I am getting below error

Get:1 http://us.archive.ubuntu.com/ubuntu focal InRelease [265 kB]                                                                           
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                 
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                                                                                   
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                             
Ign:6 https://download.docker.com/linux/ubuntu focal InRelease                                             
Err:7 https://download.docker.com/linux/ubuntu focal Release
  404  Not Found [IP: 13.225.7.126 443]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [89.1 kB]
Hit:9 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

when running command

sudo apt-get install docker-ce docker-ce-cli containerd.io

I get error

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
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'

What is the reason for this? I am new to docker. Is there a workaround to this or should I install docker using source code or something? Thank you.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Menuka Ishan
  • 5,164
  • 3
  • 50
  • 66
  • 1
    Docker's internal repos is not supported on 20.04 yet. – Matthew Schuchard Apr 24 '20 at 12:51
  • @MattSchuchard this can be done using below selected answer – Menuka Ishan Apr 26 '20 at 13:42
  • I forget to add the stable channel to the repository, add `echo \ deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null` and try to install it will work – Abrar Ansari Feb 05 '22 at 10:54

8 Answers8

71

For the moment, you can use :

sudo apt-get install -y docker.io

And then check with :

docker -v
Wared
  • 726
  • 5
  • 4
12

According to the documentation followed by a test on my PC, these instructions will install docker successfully on WMware Ubuntu focal:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl  gnupg
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

enter image description here

H Aßdøµ
  • 2,925
  • 4
  • 26
  • 37
  • Actually the "apt-get update" again everyone misses lol n goes for docker.io installation. So the above thing is correct. Do the apt-get update again. Then try. – Biddut Mitra May 15 '22 at 17:31
9

Docker has not released the repository for focal fossa (20.04) yet. As @Wared said, running

sudo apt install -y docker.io

will get docker from ubuntu repository.

I am able to use all my docker images that I used to in 18.04 successfully on 20.04 with this docker installation.

Kunal Shah
  • 1,011
  • 1
  • 8
  • 13
  • This is the only thing that worked for me. I'm using a new DigitalOcean droplet with uname -a Linux dev-2 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux – Bryan Aug 31 '20 at 17:43
5

I know the question is about Ubuntu 20. But in case you are trying to install it on Linux Mint 20 (like me), the problem looks the same but the answer is different.

The installation guide tells you to add the PPA like this:

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

However, the $(lsb_release -cs) part is the problem, because it passes the release name as a parameter to the repository command. In Ubuntu 20 that command outputs focal and everything goes well, but in Linux Mint that command outputs ulyana and it fails because docker does not have that release.

If you want to install it on mint, just replace that command with the focal string so you get the ubuntu focal version:

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
focal \
stable"
Jens
  • 5,767
  • 5
  • 54
  • 69
2

According to the information at https://docs.docker.com/engine/install/ubuntu/ Ubuntu 20.04 is not supported at the moment.

enter image description here

vkozyrev
  • 1,770
  • 13
  • 13
  • 4
    They updated the page, now 20.04 appears in the list, but the repository is still not working. – Jens Jul 15 '20 at 02:01
  • Forget what I said, my problem was that I was trying to install it on Linux Mint. – Jens Jul 15 '20 at 02:30
2

The docker repositories for Ubuntu 20.04 LTS arent ready yet (I dont understand why they didnt concentrate on that instead of getting out a version for non LTS releases like 19.10!).

But the version that is already available in the Ubuntu Universe repository is recent, so just use this in the meantime.

When the guys at Docker are ready to publish their 20.04 repo, just follow this instruction: https://docs.docker.com/engine/install/ubuntu/

..then, of course also including the section "Uninstalling old versions". This way, you can already start to use Docker on Ubuntu 20.04

Markus
  • 121
  • 1
  • It would help if you provide instructions for installing from "Ubuntu Universe". – Iulian Onofrei Sep 01 '20 at 22:09
  • lol why? this is the recommended way.. for applications like that, you never use outdated distributor packages. – Markus Sep 07 '20 at 20:57
  • I said that because I don't know what "Ubuntu Universe" is, or how to use it, and thought that maybe I'm not the only one that would benefit from some extra info. – Iulian Onofrei Sep 08 '20 at 09:07
1

The above error occurs due to unclean copy of the commands. Please consider this and copy the command once again to resolve the error. It helped me rectify the same error.

  • Seems like I had been also suffering from this. copied the commands to a text file, copied from it and executed and everything went well. – Pavindu Apr 08 '22 at 04:46
0

This is what solved my problem:

dpkg -i --ignore-depends=docker-ce lando-stable.deb

FROM https://docs.lando.dev/getting-started/installation.html#caveats

Felipe Barone
  • 76
  • 1
  • 4