Docker Repository Does Not Have a Release File on Running apt-get update on Ubuntu

UbuntuDockerApt Get

Ubuntu Problem Overview


I am using Ubuntu 16.10 and recently installed Docker (v1.12.4) using the Xenial build by following the instructions found here. I haven't encountered any problems creating containers, ensuring they restart automatically, etc.

However, now every time I run apt-get update I receive the following error message:

W: The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.

I have tried to remedy the problem by following the advice found here and cannot seem to solve this problem.

Has anyone encountered this before and fixed it? If so, what is needed to resolve this?

Ubuntu Solutions


Solution 1 - Ubuntu

On Linux Mint, the official instructions did not work for me. I had to go into /etc/apt/sources.list.d/additional-repositories.list and change serena to xenial to reflect my Ubuntu codename. Depending on your Debian variant, version, and the original installation method followed, you may need to modify /etc/apt/sources.list.d/docker.list instead.

You can typically find the appropriate codename by running one of a few different commands. In the following examples, focal is the codename:

$ grep CODENAME /etc/os-release
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

$ lsb_release -c
Codename:	focal

# NOTE: On Ubuntu 20.04.2, /etc/os-release is symlinked to /usr/lib/os-release and
#       lsb_release reads from /usr/lib/os-release.

Solution 2 - Ubuntu

For Linux Mint, this problem is actually referenced in the Docker website:

> Note: The lsb_release -cs sub-command below returns the name of your > Ubuntu distribution, such as xenial. Sometimes, in a distribution like > Linux Mint, you might have to change $(lsb_release -cs) to your parent > Ubuntu distribution. For example, if you are using Linux Mint Rafaela, > you could use trusty.

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

The lsb_release -cs command gives a repository for which Docker has no prepared package - you must change it to xenial.

The correct command for Linux Mint 18 which is based on Ubuntu 16.04 Xenial is

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   xenial \
   stable"

Solution 3 - Ubuntu

Elliot Beach is correct. Thanks Elliot.

Here is the code from my gist.

sudo apt-get remove docker docker-engine docker.io

sudo apt-get update

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

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"

sudo apt-get update

sudo apt-get install docker-ce

sudo docker run hello-world

Solution 4 - Ubuntu

As suggested in official docker document also. Try running this:

  • sudo vi /etc/apt/sources.list

Then remove/comment any (deb [arch=amd64] https://download.docker.com/linux/ubuntu/ xenial stable) such entry at the last lines of the file.

Then in terminal run this command:

  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ bionic stable"

  • sudo apt-get update

It worked in my case.

Solution 5 - Ubuntu

Linux Mint 20 Ulyana users need to change "ulyana" to "bionic" in

/etc/apt/sources.list.d/additional-repositories.list

like so:

deb [arch=amd64] https://download.docker.com/linux/ubuntu    bionic    stable

Solution 6 - Ubuntu

I saw an interesting post from Ikraider here that solved my issue : https://github.com/docker/docker/issues/22599

Website instructions are wrong, here is what works in 16.04:

curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install docker-engine=1.13.0-0~ubuntu-xenial

Solution 7 - Ubuntu

I was facing similar issue on Linux mint what I did was found out Debian version using,

$ cat /etc/debian_version buster/sid

then replaced Debian version in

$ sudo vi /etc/apt/sources.list.d/additional-repositories.list
deb [arch=amd64] https://download.docker.com/linux/debian    buster    stable

Solution 8 - Ubuntu

I also had a similar issue. Someone might find what worked for me helpful.

Machine is running Ubuntu 16.04 and has Docker CE. After looking through the answers and links provided here, especially from the link from the Docker website given by Elliot Beach, I opened my /etc/apt/sources.list and examined it.

The file had both deb [arch=amd64] https://download.docker.com/linux/ubuntu (lsb_release -cs) stable and deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.

Since the second one was what was needed, I simply commented out the first, saved the document and now the issue is fixed. As a test, I went back into the same document, removed the comment sign and ran sudo apt-get update again. The issue returned when I did that.

So to recap : not only did I have my parent Ubuntu distribution name as stated on the Docker website but I also commented out the line still containing (lsb_release -cs).

Solution 9 - Ubuntu

Editing file /etc/apt/sources.list.d/additional-repositories.list and adding deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable worked for me, this post was very helpful https://github.com/typora/typora-issues/issues/2065

Solution 10 - Ubuntu

I still have the same issue. None of the answers above seem to solve it. I have ubuntu 16.04, and I follow the steps described in https://docs.docker.com/install/linux/docker-ce/ubuntu/

I suspect it is related to an apt-get bug regarding https. The information being printed by apt-get is kind of misleading.

I think that Failed to fetch.. can also be translated as: problem accessing resource from within an https connection

How did I come to this conclusion:

First of all I am behind a corporate proxy so I have set the following configuration:

/etc/apt/apt.conf

Acquire::http::proxy "http://squidproxy:8080/";
Acquire::https::proxy "http://squidproxy:8080/";
Acquire::ftp::proxy "ftp://squidproxy:8080/";

Acquire::https::CaInfo     "/etc/ssl/certs/ca-certificates.pem";

/etc/apt/apt.conf.d/99proxy

Acquire::http::Proxy {
    localhost DIRECT;
    localhost:9020 DIRECT;
    localhost:9021 DIRECT;
};

I performed the following tests with differrent entries in sources.list

#test entry 1:

deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

sudo apt-get update

W: The repository 'https://download.docker.com/linux/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration     details.
E: Failed to fetch     https://download.docker.com/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages  
E: Some index files failed to download. They have been ignored, or old ones used instead.

Failure

test entry 2:

deb [arch=amd64] http://localhost:9020/linux/ubuntu xenial stable

/etc/apache2/sites-enabled/apt-proxy.conf

# http to https reverse proxy configuration.
Listen 9020
<VirtualHost *:9020>
SSLProxyEngine On
# pass from squid proxy
ProxyRemote https://download.docker.com/ http://squidproxy:8080
ProxyPass / https://download.docker.com/
ProxyPassReverse / https://download.docker.com/
ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
</VirtualHost>

sudo apt-get update

Hit:1 ..
Hit:2 ..
  ...                                                              
Hit:7 http://localhost:9020/linux/ubuntu xenial InRelease                
Get:8 ...
Fetched 323 kB in 0s (419 kB/s)
Reading package lists... Done

Success

test entry 3:

deb [arch=amd64] https://localhost:9021/linux/ubuntu xenial stable

/etc/apache2/sites-enabled/apt-proxy.conf

# https to https revere proxy
Listen 9021
<VirtualHost *:9021>
# serve on https
SSLEngine on
SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLProxyEngine On
# pass from squid proxy
ProxyRemote https://download.docker.com/ http://squidproxy:8080
ProxyPass / https://download.docker.com/
ProxyPassReverse / https://download.docker.com/
ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
</VirtualHost>

sudo apt-get update

W: The repository 'https://localhost:9021/linux/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://localhost:9021/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages  
E: Some index files failed to download. They have been ignored, or old ones used instead.

Failure


In the above cases the url which apt-get Failed to fetch and also the Release file, were actually accessible from browser / wget / curl using the same proxy configuration.
The fact that apt-get worked only with http reverse proxy url, implies that there is some issue accessing resources from within an https connection.
I do not know what this issue is but apt-get should show a more informative message ( apt is even less verbose ).

>Note: wiresharking case 1 showed that proxy CONNECT was successful, and no RST was sent, but of course the files could not be read.

Solution 11 - Ubuntu

In Linux Mint Change directory

cd /etc/apt/sources.list.d
ls -la

find a file call docker.list and edit it with nano text editor

sudo nano docker.list
// or
/etc/apt/sources.list.d/additional-repositories.list

Replace version of Linux mint in my case it was focal In your case, it could be bionic, focal, buster, etc

see the code name

lsb_release -a
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable

Solution 12 - Ubuntu

What worked for me on Linux Mint 20.3 Cinnamon.

Checking debian version:

$ cat /etc/debian_version 
bullseye/sid

then opening the file in xed editor

sudo xed /etc/apt/sources.list.d/docker.list

and updating the version from una to bullseye.

Solution 13 - Ubuntu

This is what worked for me on LinuxMint 19.

curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Solution 14 - Ubuntu

Best check for this problem : (If you are behind proxy),(tested on ubuntu 18.04), (will work on other ubuntu also),(mostly error in : https_proxy="http://192.168.0.251:808/)

  1. Check these files:

     #sudo cat /etc/environment :
     http_proxy="http://192.168.0.251:808/"
     https_proxy="http://192.168.0.251:808/"
     ftp_proxy="ftp://192.168.0.251:808/"
     socks_proxy="socks://192.168.0.251:808/"
     #sudo cat /etc/apt/apt.conf :
     Acquire::http::proxy "http://192.168.0.251:808/";
     Acquire::https::proxy "http://192.168.0.251:808/";
     Acquire::ftp::proxy "ftp://192.168.0.251:808/";
     Acquire::socks::proxy "socks://192.168.0.251:808/";
    
  2. Add docker stable repo

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

     #sudo apt-get update
    
  4. Check Docker CE

     #apt-cache policy docker-ce
    
  5. install Docker

     #sudo apt-get install docker-ce
    

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaniel EagleView Question on Stackoverflow
Solution 1 - UbuntuSalamiView Answer on Stackoverflow
Solution 2 - UbuntuElliott BeachView Answer on Stackoverflow
Solution 3 - UbuntuChristopher GovenderView Answer on Stackoverflow
Solution 4 - Ubuntuparneeti soodView Answer on Stackoverflow
Solution 5 - UbuntuAlex ParamonovView Answer on Stackoverflow
Solution 6 - UbuntuNicolas DView Answer on Stackoverflow
Solution 7 - UbuntuAbhijeet FarakateView Answer on Stackoverflow
Solution 8 - UbuntuSimeonView Answer on Stackoverflow
Solution 9 - UbuntuPrimeTimeView Answer on Stackoverflow
Solution 10 - UbuntuMarinos AnView Answer on Stackoverflow
Solution 11 - UbuntuMD SHAYONView Answer on Stackoverflow
Solution 12 - UbuntuPrashant AbdareView Answer on Stackoverflow
Solution 13 - UbuntuGilbertSView Answer on Stackoverflow
Solution 14 - UbuntuAbhishek JangidView Answer on Stackoverflow