2011年2月20日 星期日

[Tips] GPG error on Ubuntu

這幾天要做apt-get update一直發現錯誤,原本想說更新source.list就解決了,後來才發現原來錯誤訊息是GPG error,就順手更新了一下...

$ sudo apt-get update
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://deb.opera.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2019EA84E7532C8

W: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/lucid/Release.gpg  Could not connect to tw.archive.ubuntu.com:80 (140.112.8.139). - connect (110: Connection timed out)

以為是tw.archive.ubuntu.com不穩,想說改到別的mirror site,從大神那邊剛好看到這篇

先備份舊的source.list
$ cd /etc/apt
$ sudo mv source.list source.list.orig
建立新的source.list
$ sudo vim source.list
deb http://free.nchc.org.tw/ubuntu/ maverick main restricted
deb-src http://free.nchc.org.tw/ubuntu/ maverick main restricted

deb http://free.nchc.org.tw/ubuntu/ maverick-updates main restricted
deb-src http://free.nchc.org.tw/ubuntu/ maverick-updates main restricted

deb http://free.nchc.org.tw/ubuntu/ maverick universe
deb-src http://free.nchc.org.tw/ubuntu/ maverick universe
deb http://free.nchc.org.tw/ubuntu/ maverick-updates universe
deb-src http://free.nchc.org.tw/ubuntu/ maverick-updates universe

deb http://free.nchc.org.tw/ubuntu/ maverick multiverse
deb-src http://free.nchc.org.tw/ubuntu/ maverick multiverse
deb http://free.nchc.org.tw/ubuntu/ maverick-updates multiverse
deb-src http://free.nchc.org.tw/ubuntu/ maverick-updates multiverse

$ sudo apt-get update
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://deb.opera.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2019EA84E7532C8

W: Failed to fetch http://deb.opera.com/opera/dists/stable/Release  

更新&發佈GPG key
$ sudo gpg --keyserver keyserver.ubuntu.com --recv A2019EA84E7532C8
$ sudo gpg --export --armor A2019EA84E7532C8 | sudo apt-key add -
$ sudo apt-get update

沒有留言: