Ubuntu: Solves the GPG error caused by unofficial sources
[Date: 2010-03-30] |
Source: UbuntuCommunityAuthor: Ubuntu |
[Font: large, medium, and small] |
When we add an unofficial Ubuntu source to/etc/APT/sources. List to install and update some software, The sudo apt-Get update will prompt an error.
The following uses the ibus unofficial source I use as an example. The error message is as follows:
W: GPG error: http://ppa.launchpad.net jaunty release: The following signatures couldn't be verified because the public key is not available: no_pubkey 21c022aa985e0e11
W: You may want to run apt-Get update to correct these problems
That is, this unofficial source is untrusted. The solution is to import the public key of the source.
We usually use sudo to manage the system, so pay attention to it in some places. Otherwise, errors may easily occur.
Import the source public key from the Public Key Server to the current user's public key library.
$ GPG-keyserver wwwkeys.eu.pgp.net-Recv-keys 21c022aa985e0e11
There is no need to run sudo here. Just import the public key to the current user. If it is used, an error may be prompted.
GPG: Warning: unsafe ownership on configuration file '/home/username/. GnuPG/GPG. conf'
GPG: external program cballs are disabled due to unsafe options File Permissions
GPG: keyserver communications error: general error
GPG: keyserver receive failed: general error
This will cause the owner and running of GPG. conf.ProgramUser inconsistency, of course, if you run under the root user, this problem does not exist, because the public key is imported to the root user's keystore.
After the public key is imported successfully, the following prompts are displayed:
GPG: requesting key 985e0e11 from HKP server wwwkeys.eu.pgp.net
GPG: Key 985e0e11: public key "Launchpad PPA for ibus-dev" imported
GPG: Total number processed: 1
GPG: imported: 1 (RSA: 1)
Next, let apt-Get use this public key.
$ GPG-Armor-export 985e0e11 | sudo apt-key add-
Note that APT-key add can be run only by privileged users, that is, sudo. Otherwise, the following error message is displayed:
GPG: No writable keyring found: EOF
GPG: Error reading '-': general error
GPG: import from '-' failed: general error
After the import is successful, sudo apt-Get update will not receive any error message.
Http://www.coder4.com/archives/1445