Docker Community Forums

Share and learn in the Docker community.

[install error] The repository 'https://download.docker.com/linux/ubuntu focal Release' does not have a Release file

Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

in the install docker engine area

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.

Do you have some kind of proxy? When Ubuntu can’t find the Release file it means it gets different webpage than it expects. Try to run this:

curl -v https://download.docker.com/linux/ubuntu/

You should see something like this:


*   Trying 52.84.109.33:443...
* TCP_NODELAY set
* Connected to download.docker.com (52.84.109.33) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.docker.com
*  start date: Feb  1 00:00:00 2021 GMT
*  expire date: Mar  2 23:59:59 2022 GMT
*  subjectAltName: host "download.docker.com" matched cert's "*.docker.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0xaaab02ce8cd0)
> GET /linux/ubuntu/ HTTP/2
> Host: download.docker.com
> user-agent: curl/7.68.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: text/html
< content-length: 355
< x-amz-meta-s3cmd-attrs: md5:b5f3fb80e608da758d5c0af5c6e9816b
< last-modified: Thu, 18 Nov 2021 15:19:07 GMT
< server: AmazonS3
< date: Fri, 19 Nov 2021 23:08:30 GMT
< etag: "b5f3fb80e608da758d5c0af5c6e9816b"
< x-cache: Hit from cloudfront
< via: 1.1 4edce116e06c983cb09d08fe710ffbe4.cloudfront.net (CloudFront)
< x-amz-cf-pop: BUD50-C1
< x-amz-cf-id: C9tdwIQnZ5AdilfReOBe-nB_mRGFtVPaBKIAiwLSF8OV1cb8rRb_iA==
< age: 86
<
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Index of linux/ubuntu/</title>
</head>
<body>
<h1>Index of linux/ubuntu/</h1>
<hr>
<pre><a href="../">../</a>
<a href="dists/">dists/</a>
<a href="gpg">gpg</a>                                                                                   2021-11-18 15:13:22 3.7 KiB
</pre><hr></body></html>
* Connection #0 to host download.docker.com left intact

So you have to see links to dists and gpg

i’m use to proxy, the result of trying

curl -v https://download.docker.com/linux/ubuntu/

is It is as below.

* Uses proxy env variable https_proxy == 'http://myip:3128'
*   Trying myip:3128...
* TCP_NODELAY set
* Connected to myIp (myIp) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to download.docker.com:443
> CONNECT download.docker.com:443 HTTP/1.1
> Host: download.docker.com:443
> User-Agent: curl/7.68.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 200 Connection established
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.docker.com
*  start date: Feb  1 00:00:00 2021 GMT
*  expire date: Mar  2 23:59:59 2022 GMT
*  subjectAltName: host "download.docker.com" matched cert's "*.docker.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x5639b8c33e10)
> GET /linux/ubuntu/ HTTP/2
> Host: download.docker.com
> user-agent: curl/7.68.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: text/html
< content-length: 355
< x-amz-meta-s3cmd-attrs: md5:b5f3fb80e608da758d5c0af5c6e9816b
< last-modified: Thu, 18 Nov 2021 15:19:07 GMT
< server: AmazonS3
< date: Sun, 21 Nov 2021 02:12:04 GMT
< etag: "b5f3fb80e608da758d5c0af5c6e9816b"
< x-cache: Hit from cloudfront
< via: 1.1 4bf8622e8adc65246ece8c303890ee89.cloudfront.net (CloudFront)
< x-amz-cf-pop: ICN55-C1
< x-amz-cf-id: W8p-1CcBoQCH_7vtDimOH_RNCfF5S4OVwMt2j3m_AbEcxUaEJN4V5g==
< age: 10440
<
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Index of linux/ubuntu/</title>
</head>
<body>
<h1>Index of linux/ubuntu/</h1>
<hr>
<pre><a href="../">../</a>
<a href="dists/">dists/</a>
<a href="gpg">gpg</a>                                                                                   2021-11-18 15:13:22 3.7 KiB
</pre><hr></body></html>
* Connection #0 to host myIp left intact

But sudo apt-get update still throws an error.

Err:2 Index of linux/ubuntu/ focal Release
Could not handshake: An unexpected TLS packet was received. [IP: myip 3128]

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

Acquire::http::proxy "http://myip:3128/";
Acquire::https::proxy "http://myip:3128/";

i set the proxy conf

web_admin@Autoqanode01:~$ cat /etc/apt/apt.conf.d/dockerproxy
Acquire::http::proxy "http://myip:3128/";

Acquire::https::proxy "http://myip:3128/";

and set ~/.bashrc export proxy with root account and web_admins account
root account

export https_proxy="http://myip:3128"
export http_proxy="http://myip:3128"

web_admin account

export https_proxy="http://myip:3128"
export http_proxy="http://myip:3128"

**The result is as below **

sudo -E apt update

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 root account is the same.

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:

grep -i -r /etc/apt "proxy"

We found that there was a problem with the dns setting on the company’s internal server and the function worked.

thank you.