最新消息:20210917 已从crifan.com换到crifan.org

【已解决】sudo apt-get update报错:W GPG error signatures couldn’t be verified because the public key is not available NO_PUBKEY

报错 crifan 668浏览 0评论
折腾:
【未解决】Ubuntu中升级Python 3.5到最新版的Python 3.7
期间,Ubuntu中运行sudo apt-get update报错:
# sudo apt-get update
Hit:1 http://mirrors.tencentyun.com/ubuntu xenial InRelease
Get:2 http://mirrors.tencentyun.com/ubuntu xenial-security InRelease [109 kB]
Get:3 http://mirrors.tencentyun.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://mirrors.tencentyun.com/ubuntu xenial-updates/main amd64 Packages [967 kB]
Get:5 http://mirrors.tencentyun.com/ubuntu xenial-updates/main i386 Packages [829 kB]           
Get:6 http://mirrors.tencentyun.com/ubuntu xenial-updates/universe amd64 Packages [750 kB]               
Get:7 http://mirrors.tencentyun.com/ubuntu xenial-updates/universe i386 Packages [685 kB]                
Get:8 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]                              
Ign:8 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                                   
Hit:9 http://nginx.org/packages/ubuntu xenial InRelease                                                                                                                  
Fetched 3,474 kB in 11s (306 kB/s)                                                                                                                                       
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W GPG error ppa.launchpad.net InRelease The following signatures couldn’t be verified because the public key is not available NO_PUBKEY
apt – How do I fix the GPG error “NO_PUBKEY”? – Ask Ubuntu
# sudo add-apt-repository ppa:webupd8team/y-ppa-manager
 Y PPA Manager

Info: 
http://www.webupd8.org/2010/11/y-ppa-manager-easily-search-add-remove.html

This PPA is for Y PPA Manager and also includes the latest YAD for the supported Ubuntu versions (YAD is a dependency for Y PPA Manager): 
http://sourceforge.net/p/yad-dialog/
 More info: 
https://launchpad.net/~webupd8team/+archive/ubuntu/y-ppa-manager
Press [ENTER] to continue or ctrl-c to cancel adding it
回车后,继续:
gpg: keyring `/tmp/tmpv3m9c2le/secring.gpg' created
gpg: keyring `/tmp/tmpv3m9c2le/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpv3m9c2le/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
然后再去:
# sudo apt-get update
Hit:1 http://mirrors.tencentyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.tencentyun.com/ubuntu xenial-security InRelease
Hit:3 http://mirrors.tencentyun.com/ubuntu xenial-updates InRelease
Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]                            
Ign:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                                   
Get:5 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial InRelease [17.5 kB]          
Get:6 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial/main amd64 Packages [1,096 B]
Get:7 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial/main i386 Packages [1,092 B]
Get:8 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial/main Translation-en [924 B]                                                                       
Hit:9 http://nginx.org/packages/ubuntu xenial InRelease                                                                                                                  
Fetched 44.5 kB in 22s (1,977 B/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
问题依旧。
继续去:
sudo apt-get install y-ppa-manager
结果出错:
Processing triggers for dictionaries-common (1.26.3) ...
aspell-autobuildhash: processing: en [en-common].
aspell-autobuildhash: processing: en [en-variant_0].
aspell-autobuildhash: processing: en [en-variant_1].
aspell-autobuildhash: processing: en [en-variant_2].
aspell-autobuildhash: processing: en [en-w_accents-only].
aspell-autobuildhash: processing: en [en-wo_accents-only].
aspell-autobuildhash: processing: en [en_CA-variant_0].
aspell-autobuildhash: processing: en [en_CA-variant_1].
aspell-autobuildhash: processing: en [en_CA-w_accents-only].
aspell-autobuildhash: processing: en [en_CA-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-variant_0].
aspell-autobuildhash: processing: en [en_GB-variant_1].
aspell-autobuildhash: processing: en [en_US-w_accents-only].
aspell-autobuildhash: processing: en [en_US-wo_accents-only].
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
然后再去:
# y-ppa-manager
root@VM-158-80-ubuntu:~/xxx/xxx-backend# Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused


(Y PPA Manager:16549): Gtk-WARNING **: cannot open display: 
^C
root@VM-158-80-ubuntu:~/xxx/xxx-backend# ^C
放弃。
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C
Executing: /tmp/tmp.5qpkr3XWEZ/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
4F4EA0AAE5267A6C
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
继续:
# sudo apt-get update
Hit:1 http://mirrors.tencentyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.tencentyun.com/ubuntu xenial-security InRelease     
Hit:3 http://mirrors.tencentyun.com/ubuntu xenial-updates InRelease      
Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]                            
Hit:5 http://nginx.org/packages/ubuntu xenial InRelease                      
Hit:6 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu xenial InRelease

Reading package lists... Done
【总结】
最后是:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C
解决了问题。
其中的4F4EA0AAE5267A6C
是报错信息:
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
中的:4F4EA0AAE5267A6C

转载请注明:在路上 » 【已解决】sudo apt-get update报错:W GPG error signatures couldn’t be verified because the public key is not available NO_PUBKEY

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
94 queries in 0.178 seconds, using 23.43MB memory