169

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?

5
  • 2
    Please see if this helps - askubuntu.com/questions/768569/…
    – Rao
    Commented Dec 14, 2016 at 2: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. Commented Dec 14, 2016 at 2: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. Commented Dec 14, 2016 at 4: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. github.com/moby/moby/issues/22599#issuecomment-404675734
    – jamshid
    Commented Jul 15, 2018 at 19:17
  • More details in this video youtube.com/watch?v=PivpCKEiQOQ
    – NVRM
    Commented Feb 14 at 18:28

18 Answers 18

153

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.

Another simple way to install docker in Linux using the repository:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

According to docker doc, I had to replace this $(. /etc/os-release && echo "$VERSION_CODENAME") with the latest stable debian release bookworm

5
  • 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
    Commented Mar 25, 2018 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
    Commented Jun 1, 2019 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
    Commented Aug 30, 2019 at 20:41
  • 2
    I had to change mine to bionic Commented Jun 16, 2020 at 3: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
    Commented Feb 24, 2021 at 16:11
104

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"
3
  • 2
    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
    Commented Jun 26, 2018 at 8:46
  • This solved my issues getting things moving on the new WLinux distro also.
    – rainabba
    Commented Sep 25, 2018 at 16:53
  • 1
    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. For example, I'm running Linux Mint Vera that's based on Ubuntu Jammy, so I changed [CODENAME] from vera to jammy
    – Jinx
    Commented Jan 27, 2023 at 20:43
44

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
3
  • 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
    Commented Oct 15, 2018 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
    Commented Dec 8, 2018 at 20:52
  • 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 (stackoverflow.com/questions/60274857/…)
    – Leamsi
    Commented Feb 20, 2020 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.

16

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.

3
  • 2
    In my case it was the otherway around. I changed ubuntu to debian and it worked.
    – kmchmk
    Commented Jan 16, 2024 at 5:00
  • This was the same issue with Pop_OS.
    – Excalibur
    Commented May 24, 2024 at 16:36
  • In my case it was the otherway around. I changed ubuntu to debian and it worked - same here to.
    – drascom
    Commented Jul 16, 2024 at 15:04
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
3
  • Linux Mint 20 Ulyana is built on top of the latest Ubuntu 20.04 LTS Focal Fossa. Use focal insted Commented Feb 8, 2021 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
    Commented Oct 7, 2021 at 7:32
  • changing from ulyana to bionic worked. Thanks Commented Oct 10, 2021 at 1:34
12

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.

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
    Commented Aug 22, 2022 at 18:56
  • Thanks, this also worked for me on Linux Mint 21, I just changed it to jammy
    – Netsu
    Commented Dec 15, 2022 at 8:21
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
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
1
  • 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
    Commented Sep 20, 2021 at 13:55
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).

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

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

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.

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

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
    

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.