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.
Docker package is available in the native apt repository. The installation package available in the repository will not be the latest version. If you want to install the latest release of Docker, you need to install it from the source.
To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions: Ubuntu Jammy 22.04 (LTS) Ubuntu Impish 21.10. Ubuntu Focal 20.04 (LTS)
Docker depends on the Linux kernel to operate correctly. Since it doesn't virtualize components, its host OS needs to have access to the Linux kernel and other Linux components. That means you can only use Docker to run the Linux OS and not Windows or Mac OS.
For the moment, you can use :
sudo apt-get install -y docker.io
And then check with :
docker -v
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
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.
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"
According to the information at https://docs.docker.com/engine/install/ubuntu/ Ubuntu 20.04 is not supported at the moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With