Docker kann auf meinem Ubuntu nicht installiert werden, da im apt-get update ein „NO_PUBKEY 7EA0A9C3F273FCD8“-Fehler auftritt

Docker kann auf meinem Ubuntu nicht installiert werden, da im apt-get update ein „NO_PUBKEY 7EA0A9C3F273FCD8“-Fehler auftritt

Ich versuche, Docker auf Ubuntu 20.04 LTS zu installieren. Ich verwendedie offiziellen Dokumente. Ich habe es schon einmal ohne Probleme gemacht.

Hier ist der Fehler nach der Ausführung sudo apt-get update:

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                                       
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                             
Hit:4 http://ir.archive.ubuntu.com/ubuntu focal InRelease                   
Hit:5 http://ir.archive.ubuntu.com/ubuntu focal-updates InRelease              
Get:6 https://download.docker.com/linux/ubuntu focal InRelease [52.1 kB]       
Hit:7 http://ir.archive.ubuntu.com/ubuntu focal-backports InRelease                        
Err:6 https://download.docker.com/linux/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Reading package lists... Done      
W: GPG error: https://download.docker.com/linux/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://download.docker.com/linux/ubuntu focal InRelease' is not signed.
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.

ich sahWie behebe ich den GPG-Fehler „NO_PUBKEY“?aber ich konnte das Problem nicht lösen.

Antwort1

Sie sollten noch einmal überprüfen, ob der zweite Schritt in der Docker-Dokumentation auf Ihrem System angewendet wurde:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Ohne dies können Sie keine Verbindung zum Repo herstellen. Ich habe gerade die Installationsschritte auf einer frischen Ubuntu-Installation getestet und alles hat problemlos funktioniert. Hoffentlich ist das alles, was Sie tun müssen

Antwort2

Ich musste die Berechtigungen zweimal ändern:

sudo chmod 755 /etc/apt/keyrings
sudo chmod a+r /etc/apt/keyrings/docker.gpg

Meine Standard-Umask hat Apt daran gehindert, den Ordner überhaupt zu lesen … hoffe, das hilft jemandem.

Antwort3

Nur mit

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

hat mein Problem nicht gelöst.

Ich brauche noch:

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

und dann sudo apt-get updatefunktioniert es gut.

Inspiriert vonhttps://stackoverflow.com/a/68764068/7701908.

Antwort4

Wenn die Lösung nicht funktioniert, ist ein zusätzlicher Schritt erforderlich. Stellen Sie sicher, dass der Docker-Eintrag in der Quellenliste den Speicherort des heruntergeladenen Schlüssels enthält:

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

verwandte Informationen