I’m trying to follow the official documentation.
However, when I run the command sudo apt-get install docker-ce docker-ce-cli containerd.io
I get the following message:
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'
Also, when running apt-cache madison docker-ce
, nothing shows up in the terminal…
3
Answers
use
curl https://get.docker.com/ | bash -
this is an automated script that will work in most of the cases1. Update APT:
2. Install these packages first:
3. Add GPG keys:
4. Then add Docker repository:
5. Update again:
6. Install docker-ce, cli and containerd.io:
must work – be sure to execute all commands as root or with sudo.
You can also use their script to automate everything:
Install
docker
is pretty straightforward: