Search code examples
dockerubuntu-22.04

Ubuntu 22.04 cannot install docker, error during apt-get update


These are the steps that I did:

$ sudo apt-get update
$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

This is the terminal log (the error is here):

$ sudo apt-get update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://id.archive.ubuntu.com/ubuntu jammy InRelease           
Hit:3 http://id.archive.ubuntu.com/ubuntu jammy-updates InRelease   
Hit:4 http://id.archive.ubuntu.com/ubuntu jammy-backports InRelease 
Ign:5 https://download.docker.com/linux/debian jammy InRelease
Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Err:7 https://download.docker.com/linux/debian jammy Release
  404  Not Found [IP: 108.138.141.89 443]
Reading package lists... Done                           
E: The repository 'https://download.docker.com/linux/debian jammy 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.

but if we look at https://download.docker.com/linux/ubuntu/dists/jammy/ it's obviously has the Jammy Release file, i'm not sure what's wrong with it.

My system info:

            .-/+oossssoo+/-.               tonysong@tonysong-desktop 
        `:+ssssssssssssssssss+:`           ------------------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.15.0-39-generic 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 29 mins 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 1591 (dpkg), 11 (snap) 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.1.16 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Resolution: 2560x1440 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   DE: GNOME 42.1 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM Theme: Adwaita 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Theme: Yaru-blue-dark [GTK2/3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Icons: Yaru-blue [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Terminal: gnome-terminal 
  +sssssssssdmydMMMMMMMMddddyssssssss+     CPU: AMD Ryzen 7 5700G with Radeon Graphics (16) @ 4.673GH 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      GPU: AMD ATI 04:00.0 Cezanne 
    .ossssssssssssssssssdMMMNysssso.       Memory: 5179MiB / 31477MiB 
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`                                   
            .-/+oossssoo+/-.                                       

Solution

  • Why do you using debian in https://download.docker.com/linux/debian/gpg URL (and echo command)?

    It is should be ubuntu: https://download.docker.com/linux/ubuntu/...

    Please re-check documentation.

    but if we look at https://download.docker.com/linux/ubuntu/dists/jammy/ it's obviously has the Jammy Release file, i'm not sure what's wrong with it.

    Yep, if we look it is .../linux/ubuntu/...