dockerubuntudebianapt

Update docker on Debian 10


I try to update docker on Debian, with the following command:

sudo apt-get update --allow-releaseinfo-change

But I got the following error message:

Hit:1 http://asi-fs-n.contabo.net/debian buster InRelease
Hit:2 http://asi-fs-n.contabo.net/debian buster-updates InRelease
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Get:4 https://download.docker.com/linux/debian buster InRelease [54.0 kB]
Hit:5 https://download.docker.com/linux/ubuntu zesty InRelease
Ign:6 https://download.docker.com/linux/ubuntu docker InRelease
Err:7 https://download.docker.com/linux/ubuntu docker Release
  404  Not Found [IP: 13.224.94.87 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu docker 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.

From another StackOverflow topic, it seems I must update the file /etc/apt/sources.list.d/docker.list

I tried the following (but it does not work):

deb https://get.docker.io/ubuntu docker main

Noticed that:

Should I change to something like, without corrupting/breaking my operating system?

deb https://download.docker.com/linux/debian docker buster

Solution

  • See Install Docker Engine on Debian. Use the following commands:

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
    echo \
    "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs 2>/dev/null) stable" |\
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

    The first command will download the gpg key, the second one will adjust your docker.list file.

    Then run sudo apt update