GPG error W: GPG error: http://packages.elastic.co stable Release: The following signatures could...

报错信息:

W: GPG error: http://packages.elastic.co stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D27D666CD88E42B4

方法一

将 /var/lib/apt/lists 删除并重新建一个lists 目的是将文件清除

sudo rm -rf /var/lib/apt/lists && sudo mkdir /var/lib/apt/lists

执行 sudo apt-get update
不行的话再试试下边

方法二

执行 换秘钥命令

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192

执行 sudo apt-get update
不行的话再试试下边

终极方法

删除 下载源信息

sudo vim /etc/apt/sources.list

将所有的信息删掉
然后加上163的源地址

deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
执行 sudo apt-get update

不行的话再试试下边

有时候重装系统是个不错的选择

你可能感兴趣的:(GPG error W: GPG error: http://packages.elastic.co stable Release: The following signatures could...)