Answers:
我发现了这两种方法。第一种似乎是最安全的方法。
$ sudo -i
$ apt-get clean
$ cd /var/lib/apt
$ mv lists lists.old
$ mkdir -p lists/partial
$ apt-get clean
$ apt-get update
您可以使用此命令apt-key
生成相应的gpg
命令,以下载适用于Canonical的密钥。
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com
gpg: key 437D05B5: "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>" 25 new signatures
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: new signatures: 25
如果使用此命令,则可以窥探第二种方法:
$ sudo -i
$ bash -x apt-key update |& less
+ set -e
+ unset GREP_OPTIONS
++ mktemp
+ SECRETKEYRING=/tmp/tmp.ZhVikJSB3s
+ trap 'rm -f '\''/tmp/tmp.ZhVikJSB3s'\''' 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+ GPG_CMD='gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.ZhVikJSB3s'
++ id -u
+ '[' 0 -eq 0 ']'
++ apt-config shell TRUSTDBDIR Dir::Etc/d
+ eval 'TRUSTDBDIR='\''/etc/apt/'\'''
...
此命令也可以作为普通用户而不是root用户使用!:
$ apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5 Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.kZ1TEwcI5s --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
gpg: requesting key 437D05B5 from hkp server keyserver.ubuntu.com
gpg: error writing keyring `/etc/apt/trusted.gpg': file write error
gpg: key 437D05B5: "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>" 26 new signatures
gpg: error reading `[stream]': file write error
gpg: Total number processed: 0
gpg: new signatures: 26
keyserver.ubuntu.com
选择Debian?