apt는 키를 사용할 수 없는 것처럼 가장합니다. 사실이 아니다

apt는 키를 사용할 수 없는 것처럼 가장합니다. 사실이 아니다

apt에 이상한 문제가 있어서 제거할 수 없었기 때문에 /var/lib/apt 및 /var/cache/apt를 삭제했습니다.

이제 나는 항상 다음을 얻습니다.

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.

이것은 분명히 사실이 아닙니다. 하지만 좋습니다. /etc/apt/trusted.gpg를 삭제하고 다시 시작해보세요.

# 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는 현실과 동떨어진 메시지를 보여줄 뿐입니다. 거짓말이에요! 어떻게 그렇게 될수 있니?

PS: 삭제하기 전에 /var/lib/apt 및 /var/apt/cache에서 백업을 생성했다고 말씀드리고 싶습니다. 백업을 다시 복사해도 아무런 변화가 없습니다. 그래서 다른 것이 깨진 것 같습니다.

PSS: 또한 /etc/apt, /var/lib/apt, /var/cache/apt를 삭제하고 "dpkg -i apt_1.8.2_amd64.deb"를 통해 apt를 다시 설치했습니다. 모든 디렉토리가 처음부터 다시 생성되지만 동일한 오류로 인해 적절한 업데이트가 여전히 실패합니다!

답변1

일반적으로 단순히 시스템 디렉터리를 삭제하는 것은 좋은 생각이 아닙니다. 패키지를 정리해야 하는 경우 패키지를 제거한 다음 다시 설치하는 것이 좋습니다. 현재는 손으로만 고칠 수 있는 상태로 시스템을 방치했을 수도 있지만, 작동할 수 있는 가장 쉬운 솔루션을 제공하려고 노력하겠습니다.

Debian에 적합한 키를 얻으려면 패키지를 제거한 다음 다시 설치해야 합니다 debian-archive-keyring. 이 패키지는 모든 데비안 아카이브 키를 적절한 위치에 제공하고 apt사용할 수 있도록 올바르게 설치합니다. 이러한 키는 적절한 기능을 위해 존재하며 /etc/apt필요합니다.

관련 정보