apt gibt vor, dass Schlüssel nicht verfügbar sind. Stimmt nicht

apt gibt vor, dass Schlüssel nicht verfügbar sind. Stimmt nicht

Ich habe /var/lib/apt und /var/cache/apt gelöscht, weil ich seltsame Probleme mit apt hatte, die ich nicht beheben konnte.

Jetzt bekomme ich immer:

Get:1 http://security-cdn.debian.org buster/updates InRelease [65.4 kB]
Err:1 http://security-cdn.debian.org buster/updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
Reading package lists... Done
W: GPG error: http://security-cdn.debian.org buster/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
E: The repository 'http://security.debian.org buster/updates 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.

Das ist eindeutig nicht wahr. Aber ok, lösche /etc/apt/trusted.gpg und starte es noch einmal von vorne:

# rm /etc/apt/trusted.gpg
# apt-key adv --keyserver pgp.mit.edu --recv-keys AA8E81B4331F7F50
Executing: /tmp/apt-key-gpghome.DwxpIbllfu/gpg.1.sh --keyserver pgp.mit.edu --recv-keys AA8E81B4331F7F50
gpg: key EDA0D2388AE22BA9: public key "Debian Security Archive Automatic Signing Key (9/stretch) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
# apt-key adv --keyserver pgp.mit.edu --recv-keys 112695A0E562B32A
Executing: /tmp/apt-key-gpghome.TFiPCm4ThF/gpg.1.sh --keyserver pgp.mit.edu --recv-keys 112695A0E562B32A
gpg: key 4DFAB270CAA96DFA: public key "Debian Security Archive Automatic Signing Key (10/buster) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
# apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
      6ED6 F5CB 5FA6 FB2F 460A  E88E EDA0 D238 8AE2 2BA9
uid           [ unknown] Debian Security Archive Automatic Signing Key (9/stretch) <[email protected]>
sub   rsa4096 2017-05-22 [S] [expires: 2025-05-20]

pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
      5E61 B217 265D A980 7A23  C5FF 4DFA B270 CAA9 6DFA
uid           [ unknown] Debian Security Archive Automatic Signing Key (10/buster) <[email protected]>
sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]

# apt update
Get:1 http://security-cdn.debian.org buster/updates InRelease [65.4 kB]
Err:1 http://security-cdn.debian.org buster/updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
Reading package lists... Done
W: GPG error: http://security-cdn.debian.org buster/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
E: The repository 'http://security.debian.org buster/updates 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.

Apt zeigt nur Nachrichten an, die weit von der Realität entfernt sind. Das ist eine Lüge! Wie kann das sein?

PS: Ich sollte erwähnen, dass ich ein Backup von /var/lib/apt und /var/apt/cache erstellt habe, bevor ich sie gelöscht habe. Wenn ich das Backup zurückkopiere, ändert sich nichts. Also scheint etwas anderes kaputt zu sein.

PSS: Ich habe auch /etc/apt, /var/lib/apt, /var/cache/apt gelöscht und apt über "dpkg -i apt_1.8.2_amd64.deb" neu installiert. Alle Verzeichnisse wurden von Grund auf neu erstellt, aber das Update von apt schlägt immer noch mit demselben Fehler fehl!

Antwort1

Im Allgemeinen ist es keine gute Idee, Systemverzeichnisse einfach zu löschen. Wenn Sie ein Paket bereinigen müssen, ist es besser, es zu löschen und dann neu zu installieren. Möglicherweise haben Sie Ihr System in einem Zustand hinterlassen, der jetzt nur noch manuell repariert werden kann, aber ich werde versuchen, die einfachste Lösung bereitzustellen, die funktionieren könnte.

Um die richtigen Schlüssel für Debian zu erhalten, sollten Sie das debian-archive-keyringPaket löschen und dann neu installieren. Dieses Paket stellt alle Debian-Archivschlüssel an den richtigen Orten bereit und installiert sie korrekt für aptdie Verwendung. Diese Schlüssel /etc/aptsind für die ordnungsgemäße Funktion erforderlich und werden dort gespeichert.

verwandte Informationen