1. 程式人生 > >apt-get 祕鑰問題

apt-get 祕鑰問題

出現以下這個錯誤時:

BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>

1.用vi檔案編輯工具在linux建立一人新檔案“apt-wilson.sh”;

sudo apt-get clean

cd /var/lib/apt

sudo rm -rf lists.old

sudo mv lists lists.old


gpg --delete-key --armor 40976EAF437D05B5

sudo apt-key del 40976EAF437D05B5


gpg --keyserver-options http-proxy --keyserver keyserver.ubuntu.com --recv 0976EAF437D05B5

gpg --export --armor 40976EAF437D05B5 | sudo apt-key add -


sudo mkdir -p lists/partial

sudo apt-get clean

sudo apt-get update

2.然後用命令列"./apt-wilson.sh"執行它

執行完成後還有以下錯誤

W: GPG error: http://mirrors.aliyun.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

W: GPG error: http://mirrors.aliyun.com precise-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

W: GPG error: http://mirrors.aliyun.com precise-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

W: GPG error: http://security.ubuntu.com precise-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

3.然後再執行以下命令列:

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5

4.最的再執行下面的命令列應該就沒有問題了

apt-get update