重灌ubuntu 每次都會遇到匯入金鑰的問題
有時是親自到/etc/apt/source.list去處理
有時用別人寫好的腳本
既然常要處理
把作法記下來
==================
加入 launchpad 或者其他的軟體來源(/etc/apt/source.list)後要是沒匯入金鑰,使用 apt-get update 手動更新時就會有以下的錯誤訊息出現。
jonny@ubuntu:~$ sudo apt-get update
...
...
W: GPG error: http://ppa.launchpad.net hardy Release: 由於無法取得它們的公鑰,以下簽章無法進行驗證: NO_PUBKEY 6AF0E1940624A220
W: 您也許得執行 apt-get update 以修正這些問題
下載公鑰
jonny@ubuntu:~$ sudo gpg --keyserver keyserver.ubuntu.com --recv 0624A220
# 0624A220 為 key 的後八碼。
匯入公鑰
jonny@ubuntu:~$ sudo gpg --export --armor 0624A220 | sudo apt-key add -
之後再怎麼更新都 ok 啦。
沒有留言:
張貼留言