目前使用apt-get update升级debian系统时报错如下:
# apt-get update
获取:1 http://mirrors.163.com stable Release.gpg [1672B]
命中 http://mirrors.163.com stable Release
错误 http://mirrors.163.com stable Release
获取:2 http://mirrors.163.com stable Release [104kB]
忽略 http://mirrors.163.com stable Release
忽略 http://mirrors.163.com stable/main Packages/DiffIndex
忽略 http://mirrors.163.com stable/main Sources/DiffIndex
命中 http://mirrors.163.com stable/main Packages
命中 http://mirrors.163.com stable/main Sources
下载 105kB,耗时 0s (130kB/s)
正在读取软件包列表... 完成
W: GPG error: http://mirrors.163.com stable Release: 由于没有公钥,下列签名无法进行验证: NO_PUBKEY AED4B06F473041FA NO_PUBKEY 64481591B98321F9
W: 您可能需要运行 apt-get update 来解决这些问题
解决方法如下:
使用gpg --keyserver 获取公钥
# gpg --keyserver pgpkeys.mit.edu --recv-key AED4B06F473041FA
gpg: requesting key 473041FA from hkp server pgpkeys.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 473041FA: public key "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
# gpg -a --export AED4B06F473041FA | apt-key add -
OK
# gpg --keyserver pgpkeys.mit.edu --recv-key 64481591B98321F9
gpg: requesting key B98321F9 from hkp server pgpkeys.mit.edu
gpg: key B98321F9: public key "Squeeze Stable Release Key <debian-release@lists.debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
# gpg -a --export 64481591B98321F9 | apt-key add -
OK
再次执行apt-get update成功
# apt-get update
获取:1 http://mirrors.163.com stable Release.gpg [1672B]
获取:2 http://mirrors.163.com stable Release [104kB]
忽略 http://mirrors.163.com stable/main Packages/DiffIndex
忽略 http://mirrors.163.com stable/main Sources/DiffIndex
命中 http://mirrors.163.com stable/main Packages
命中 http://mirrors.163.com stable/main Sources
下载 104kB,耗时 1s (82.4kB/s)
# apt-get update
获取:1 http://mirrors.163.com stable Release.gpg [1672B]
命中 http://mirrors.163.com stable Release
错误 http://mirrors.163.com stable Release
获取:2 http://mirrors.163.com stable Release [104kB]
忽略 http://mirrors.163.com stable Release
忽略 http://mirrors.163.com stable/main Packages/DiffIndex
忽略 http://mirrors.163.com stable/main Sources/DiffIndex
命中 http://mirrors.163.com stable/main Packages
命中 http://mirrors.163.com stable/main Sources
下载 105kB,耗时 0s (130kB/s)
正在读取软件包列表... 完成
W: GPG error: http://mirrors.163.com stable Release: 由于没有公钥,下列签名无法进行验证: NO_PUBKEY AED4B06F473041FA NO_PUBKEY 64481591B98321F9
W: 您可能需要运行 apt-get update 来解决这些问题
解决方法如下:
使用gpg --keyserver 获取公钥
# gpg --keyserver pgpkeys.mit.edu --recv-key AED4B06F473041FA
gpg: requesting key 473041FA from hkp server pgpkeys.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 473041FA: public key "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
# gpg -a --export AED4B06F473041FA | apt-key add -
OK
# gpg --keyserver pgpkeys.mit.edu --recv-key 64481591B98321F9
gpg: requesting key B98321F9 from hkp server pgpkeys.mit.edu
gpg: key B98321F9: public key "Squeeze Stable Release Key <debian-release@lists.debian.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
# gpg -a --export 64481591B98321F9 | apt-key add -
OK
再次执行apt-get update成功
# apt-get update
获取:1 http://mirrors.163.com stable Release.gpg [1672B]
获取:2 http://mirrors.163.com stable Release [104kB]
忽略 http://mirrors.163.com stable/main Packages/DiffIndex
忽略 http://mirrors.163.com stable/main Sources/DiffIndex
命中 http://mirrors.163.com stable/main Packages
命中 http://mirrors.163.com stable/main Sources
下载 104kB,耗时 1s (82.4kB/s)
正在读取软件包列表... 完成