krishna@ubuntu:~$ ls
Desktop Documents Downloads examples.desktop Music Pictures Public Templates Videos
krishna@ubuntu:~$ cd Desktop/
krishna@ubuntu:~/Desktop$ ls
key2.txt
krishna@ubuntu:~/Desktop$ sudo apt-key add key2.txt
gpg: no valid OpenPGP data found.
krishna@ubuntu:~/Desktop$ cd ..
krishna@ubuntu:~$ sudo gpg --keyserver pgpkeys.mit.edu --recv-key EEA14886
gpg: WARNING: unsafe ownership on configuration file `/home/krishna/.gnupg/gpg.conf'
gpg: external program calls are disabled due to unsafe options file permissions
gpg: keyserver communications error: general error
gpg: keyserver receive failed: general error
krishna@ubuntu:~$ sudo gpg -a --export EEA14886 | sudo apt-key add -
gpg: WARNING: unsafe ownership on configuration file `/home/krishna/.gnupg/gpg.conf'
gpg: WARNING: nothing exported
gpg: no valid OpenPGP data found.
答案1
你不应该以 root 身份运行 gpg。因此请尝试不使用 sudo 来运行 gpg。
gpg --keyserver pgpkeys.mit.edu --recv-key EEA14886
gpg: requesting key EEA14886 from hkp server pgpkeys.mit.edu
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
将密钥添加到 apt-key:
gpg -a --export EEA14886 | sudo apt-key add -
[sudo] password for arun:
OK
验证密钥:
apt-key list
/etc/apt/trusted.gpg
--------------------
pub 1024D/437D05B5 2004-09-12
uid Ubuntu Archive Automatic Signing Key <[email protected]>
sub 2048g/79164387 2004-09-12
pub 4096R/C0B21F32 2012-05-11
uid Ubuntu Archive Automatic Signing Key (2012) <[email protected]>
pub 4096R/EFE21092 2012-05-11
uid Ubuntu CD Image Automatic Signing Key (2012) <[email protected]>
pub 1024D/FBB75451 2004-12-30
uid Ubuntu CD Image Automatic Signing Key <[email protected]>
pub 4096R/C31D4FBC 2017-06-02
uid arun. <[email protected]>
pub 1024R/EEA14886 2010-05-04
uid Launchpad VLC