Error occurs when sudo apt-get update is in progress.
$ sudo apt-get update
which produced the following output:
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.
and $ sudo apt-get install docker-ce docker-ce-cli containerd.io
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'
my sudo cat sources.list.d/docker.list value
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable
how to install?
I’ve also tried running the docker install script, but it’s the same.
curl -fsSl https://get.docker.com -o get-docker.sh
web_admin@Autoqanode01:~$ sudo sh get-docker.sh
# Executing docker install script, commit: 93d2499759296ac1f9c510605fef85052a2c32be
+ sh -c apt-get update -qq >/dev/null
E: The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file.
I guess you haven’t set the proxy for APT. This is why curl works showing us it really uses the proxy server while APT doesn’t work.
You run curl without sudo and apt update with sudo. You probably set the proxy variables in the web_admin’s .bashrc which won’t be used with sudo.
1.) Use sudo with -E to preserve environment variables: sudo -E apt update
2.) or set the proxy variables in the root user’s .bashrc
3.) or set the proxy directly for APT this way in /etc/apt/apt.conf.d/05proxy
web_admin@Autoqanode01:~$ sudo -E apt update
Ign:1 https://download.docker.com/linux/ubuntu focal InRelease
Err:2 https://download.docker.com/linux/ubuntu focal Release
Could not handshake: An unexpected TLS packet was received. [IP: MyIP 3128]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-security 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.
sudo apt-get update
Ign:1 https://download.docker.com/linux/ubuntu focal InRelease
Err:2 https://download.docker.com/linux/ubuntu focal Release
Could not handshake: An unexpected TLS packet was received. [IP: myip 3128]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-security 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.
The IP address was covered in your previous comment so I couldn’t see APT probably also used the proxy. Normally I would recommend to install apt-transport-https but you wrote you tried running the installer downloaded from https://get.docker.com/ which installs this package. You can try it anyway since I don’t have other idea.
apt install apt-transport-https
If the proxy didn’t support HTTPS then curl wouldn’t work either so that couldn’t be a problem.
Actually I do have another idea but it’s unlikely that is the case. You could overwrite your first proxy rules in another config file so after trying the above command if that doesn’t work try this: