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?
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
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
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
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
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
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.
Warning: Use the below steps at your own risk. You may receive different results as indicated in the comments. Please exercise caution and have a full backup prior to doing this.
Below is a list of steps used to solve the issue:
Remove Docker (this won't delete images, containers, volumes, or customized configuration files):
sudo apt-get purge docker-engine
Remove the Docker apt key:
sudo apt-key del 58118E89F3A912897C070ADBF76221572C52609D
Delete the docker.list file:
sudo rm /etc/apt/sources.list.d/docker.list
Manually delete apt cache files:
sudo rm /var/lib/apt/lists/apt.dockerproject.org_repo_dists_ubuntu-xenial_*
Delete apt-transport-https and ca-certificates:
sudo apt-get purge apt-transport-https ca-certificates
Clean apt and perform autoremove:
sudo apt-get clean && sudo apt-get autoremove
Reboot Ubuntu:
sudo reboot
Run apt-get update:
sudo apt-get update
Install apt-transport-https and ca-certificates again:
sudo apt-get install apt-transport-https ca-certificates
Add the apt key:
> sudo apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
> echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" |
sudo tee /etc/apt/sources.list.d/docker.list
> sudo apt-get update
> sudo apt-get install docker-engine
Granted, there are plenty of variables and your results may vary. However, these steps cover as many areas as possible to ensure potential problem spots are scrubbed so that the likelihood of success is higher.
Update 7/6/2017
It appears newer versions of Docker are using a different installation process which should eliminate many of these problems. Be sure to check out https://docs.docker.com/engine/installation/linux/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.
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
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 asxenial
. 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"
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
.
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).
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
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/)
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/";
Add docker stable repo
#sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Run apt-get update:
#sudo apt-get update
Check Docker CE
#apt-cache policy docker-ce
install Docker
#sudo apt-get install docker-ce
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
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
Source: Stackoverflow.com