151

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?

Daniel Eagle
  • 2,205
  • 2
  • 18
  • 17
  • 2
    Please see if this helps - http://askubuntu.com/questions/768569/ubuntu-16-04-update-manager-error/784977 – Rao Dec 14 '16 at 02:12
  • @Rao, unfortunately this does not solve the problem. I'm still getting the same error message after removing the key, the source list entry, running apt-get update again, and then repeating the Docker installation steps. – Daniel Eagle Dec 14 '16 at 02:49
  • @Rao, I figured out the solution and added the answer. However, the article you mentioned may be beneficial to others stumbling upon my question so +1. Cheers. – Daniel Eagle Dec 14 '16 at 04:24
  • 1
    In my case the answers below didn't help. My problem was I was using apt-cacher-ng that wasn't proxying https traffic. https://github.com/moby/moby/issues/22599#issuecomment-404675734 – jamshid Jul 15 '18 at 19:17

18 Answers18

132

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.
ezkl
  • 3,829
  • 23
  • 39
Salami
  • 2,849
  • 4
  • 24
  • 33
  • 2
    Just a note, for some reason there was a docker line with `trusty` and another with `serena` in that file for me. Maybe I tried to go through this same process some time back and forgot about it. At any rate, I had to delete the `trusty` line, otherwise it complained about unresolvable dependencies. – lobati Mar 25 '18 at 15:50
  • 6
    Thanks for directory sources.list.d reference. Fixed Ubuntu xenial issue with "sudo rm /etc/apt/sources.list.d/docker*" . Now apt-get update works finally. – Andrew Jun 01 '19 at 16:31
  • 3
    The same for Debian: replace "debian 10 stable" to "debian stretch stable" in file "/etc/apt/sources.list.d/docker.list" and it should work. – peschanko Aug 30 '19 at 20:41
  • 2
    I had to change mine to ```bionic``` – jpthesolver2 Jun 16 '20 at 03:33
  • This worked, But I had to add `m` to the link it was not working `deb [arch=amd64] https://download.docker.co/linux/ubuntu bionic stable` Notice there is a missing m in the `docker.co` it should be `/docker.com/...` – Youans Feb 24 '21 at 16:11
100

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"
SharpC
  • 6,974
  • 4
  • 45
  • 40
Elliott Beach
  • 10,459
  • 9
  • 28
  • 41
  • 1
    The command you have provided is the same as the one that exists on the docker site. However it does not work for me on ubuntu 16.04. The entry generated in `sources.list` is: `deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable` But still the same problem. I wish someone could explain why it cannot find `Release` inside `https://download.docker.com/linux/ubuntu/dists/xenial/stable/binary-amd64/`. Sad: After so many years of using ubuntu I still can't figure out how things work with repository paths. – Marinos An Jun 26 '18 at 08:46
  • This solved my issues getting things moving on the new WLinux distro also. – rainabba Sep 25 '18 at 16:53
  • This worked for me. Edit `/etc/apt/sources.list.d/docker.list` and edit `deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu [CODENAME] stable` so that you change [CODENAME] from your Linux Mint codename to the Ubuntu base package name. Confirm yours from the Linux Mint version website [here](https://linuxmint.com/download_all.php). For example, I'm running Linux Mint Vera that's based on Ubuntu Jammy, so I changed [CODENAME] from `vera` to `jammy` – Jinx Jan 27 '23 at 20:43
42

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
  • 6
    Careful running these commands if not running xenial. This command would be safer `add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"` – spuder Oct 15 '18 at 18:21
  • 1
    In some cases (ie. Mint) the `lsb_release -cs` returns `tara` which doesn't have a supported release so specifically overriding to `xenial` as shown (or trusty) is a useful workaround. – Strixy Dec 08 '18 at 20:52
  • The user formally known as Elliott Beach will moving forward be referred to as Warlike Chimpanzee – Elliott Beach Mar 07 '19 at 11:14
  • Your gist fixes the "E: Package 'containerd.io' has no installation candidate" issue with Kubuntu eoan. Some people solved it with bionic, but it didn't work for me, following your gist with xenial did. The problem arises when you use `$(lsb_release -cs)` because it's not fully supported. Others report using such a "misconfiguration" hack without any issues for 4 months and counting (https://stackoverflow.com/questions/60274857/i-cant-install-docker-because-containerd-io-has-no-installation-candidate) – Leamsi Feb 20 '20 at 16:45
23

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.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
parneeti sood
  • 266
  • 2
  • 4
13

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
Alex Paramonov
  • 2,630
  • 2
  • 23
  • 27
  • Linux Mint 20 Ulyana is built on top of the latest Ubuntu 20.04 LTS Focal Fossa. Use focal insted – Marcelo Fonseca Feb 08 '21 at 21:03
  • @MarceloFonseca I'm on the latest Linux Mint version. For some strange reasons, when I tried to use focal, it kept telling me that it doesn't have a release file. It worked only when I retrieved the Debian version in /etc/debian_version. – Clockwork Oct 07 '21 at 07:32
  • changing from ulyana to bionic worked. Thanks – Mwesigye John Bosco Oct 10 '21 at 01:34
10

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
Nicolas D
  • 1,182
  • 18
  • 40
9

Although this is an older post, I ran into a similar problem just yesterday. Instructions on Docker's own website were not working for me, and I was getting a number of installation errors: (below some of the problematic lines from the terminal's output):

Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Err:7 https://download.docker.com/linux/debian focal Release
  404  Not Found [IP: 13.227.219.37 443]
Reading package lists... Done                            
E: The repository 'https://download.docker.com/linux/debian 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.
root@<my-server-name>:~# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
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'
E: Unable to locate package docker-compose-plugin
root@<my-server-name>:~# sudo apt-get upgrade

After searching and trying several fixes, I found that the response provided by #Prashant Abdare was the most useful. Upon running the following command:

$ cat /etc/debian_version

I got the following output:

bullseye/sid

As I do not have the xed editor installed, I simply replaced #Prashant Abdare's command with sudo nano on my server's root:

$ sudo nano /etc/apt/sources.list.d/docker.list

Next, I simply edited the entry (as he indicated) by changing the Debian version therein, fom to Namely, from (incorrect):

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

To (correct, for my system):

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

After this, I simply ran the following commands (from Docker's original instructions ):

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

This time, the installation worked like a charm and the previous issues (from the terminal output lines pasted above) became fixed, thus updating to version 20.10.17:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils dns-root-data dnsmasq-base libidn11 ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  docker-ce-rootless-extras docker-scan-plugin slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite
The following packages will be REMOVED:
  containerd docker.io runc
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin docker-scan-plugin slirp4netns
0 upgraded, 7 newly installed, 3 to remove and 0 not upgraded.
Need to get 108 MB of archives.
After this operation, 115 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.digitalocean.com/ubuntu focal/universe amd64 slirp4netns amd64 0.4.3-1 [74.3 kB]
Get:2 https://download.docker.com/linux/debian bullseye/stable amd64 containerd.io amd64 1.6.7-1 [28.1 MB]
Get:3 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce-cli amd64 5:20.10.17~3-0~debian-bullseye [40.6 MB]
Get:4 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce amd64 5:20.10.17~3-0~debian-bullseye [21.0 MB]
Get:5 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce-rootless-extras amd64 5:20.10.17~3-0~debian-bullseye[8159 kB]
Get:6 https://download.docker.com/linux/debian bullseye/stable amd64 docker-compose-plugin amd64 2.6.0~debian-bullseye [6562 kB]
Get:7 https://download.docker.com/linux/debian bullseye/stable amd64 docker-scan-plugin amd64 0.17.0~debian-bullseye [3520 kB]
Fetched 108 MB in 2s (44.9 MB/s)         
(Reading database ... 95602 files and directories currently installed.)
Removing docker.io (20.10.12-0ubuntu2~20.04.1) ...
'/usr/share/docker.io/contrib/nuke-graph-directory.sh' -> '/var/lib/docker/nuke-graph-directory.sh'
Removing containerd (1.5.9-0ubuntu1~20.04.4) ...
Removing runc (1.1.0-0ubuntu1~20.04.1) ...
Selecting previously unselected package containerd.io.
(Reading database ... 95340 files and directories currently installed.)
Preparing to unpack .../0-containerd.io_1.6.7-1_amd64.deb ...
Unpacking containerd.io (1.6.7-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../1-docker-ce-cli_5%3a20.10.17~3-0~debian-bullseye_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../2-docker-ce_5%3a20.10.17~3-0~debian-bullseye_amd64.deb ...
Unpacking docker-ce (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../3-docker-ce-rootless-extras_5%3a20.10.17~3-0~debian-bullseye_amd64.deb...
Unpacking docker-ce-rootless-extras (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../4-docker-compose-plugin_2.6.0~debian-bullseye_amd64.deb ...
Unpacking docker-compose-plugin (2.6.0~debian-bullseye) ...
Selecting previously unselected package docker-scan-plugin.
Preparing to unpack .../5-docker-scan-plugin_0.17.0~debian-bullseye_amd64.deb ...
Unpacking docker-scan-plugin (0.17.0~debian-bullseye) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../6-slirp4netns_0.4.3-1_amd64.deb ...
Unpacking slirp4netns (0.4.3-1) ...
Setting up slirp4netns (0.4.3-1) ...
Setting up docker-scan-plugin (0.17.0~debian-bullseye) ...
Setting up containerd.io (1.6.7-1) ...
Setting up docker-compose-plugin (2.6.0~debian-bullseye) ...
Setting up docker-ce-cli (5:20.10.17~3-0~debian-bullseye) ...
Setting up docker-ce-rootless-extras (5:20.10.17~3-0~debian-bullseye) ...
Setting up docker-ce (5:20.10.17~3-0~debian-bullseye) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
root@<my-server-name>:~# sudo nano /etc/apt/sources.list.d/docker.list
root@<my-server-name>:~# docker --version
Docker version 20.10.17, build 100c701
root@<my-server-name>:~# hostnamectl

So thanks again to @Prashant Abdare for sharing this solution, and to @Deep Kakkar for his recent edits.

Karljazz
  • 91
  • 1
  • 2
  • Hello and thank you for answering this question! I would recommend editing down the terminal outputs to the most germane lines. Especially if you're running commands in between outputs. – VanBantam Aug 22 '22 at 18:56
  • Thanks, this also worked for me on Linux Mint 21, I just changed it to jammy – Netsu Dec 15 '22 at 08:21
6

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
  • This is the only solution that worked for me. I tried the other ones suggesting to take the Ubuntu "focal" version but I still had the same error. Taking the debian_version (bullseye), it worked. – Clockwork Sep 20 '21 at 13:55
4

I'm using Kubuntu 20.04. If I cat /etc/os-release, I see:

VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy

However, in my file /etc/apt/sources.list.d/docker.list I had this line:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian jammy stable

The solution was to change debian to ubuntu, then it worked.

helvete
  • 2,455
  • 13
  • 33
  • 37
Lascou
  • 73
  • 4
3

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).

Simeon
  • 41
  • 3
  • On Ubuntu 18.10 I commented out this line: # deb [arch=amd64] https://download.docker.com/linux/ubuntu cosmic stable – Sergei G Nov 30 '18 at 22:31
3

For Linux Mint 20.3 Cinnamon following process worked for me.

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 update the version from uma to bullseye.

Deep Kakkar
  • 5,831
  • 4
  • 39
  • 75
Prashant Abdare
  • 2,175
  • 14
  • 24
2

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

PrimeTime
  • 121
  • 1
  • 6
1

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.

Marinos An
  • 9,481
  • 6
  • 63
  • 96
1

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
MD SHAYON
  • 7,001
  • 45
  • 38
1

If you are using Parrot Os Or any other debian base Os, You have to edit the docker.list in /etc/apt/sources.list.d/docker.list to use the debian release of your OS (bullseye, buster and so on).

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

The above command will open the docker.list file where you can change the link to now look like this:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bullseye stable

Just replace the bullseye with your OS debian codename And save. After that, run sudo apt-get update again.

0

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

GilbertS
  • 591
  • 8
  • 12
0

I use Linux mint 20.3

lsb_release -cs command returns una. Renaming to xenial didn't work so well but bionic did

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu bionic stable

-1

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
    
Federico Grandi
  • 6,785
  • 5
  • 30
  • 50
Abhishek Jangid
  • 1,304
  • 1
  • 7
  • 4