歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> 更新linux時候提示無法“由於沒有公鑰,無法驗證下列簽名 ***”的解決方案

更新linux時候提示無法“由於沒有公鑰,無法驗證下列簽名 ***”的解決方案

日期:2017/3/3 12:11:45   编辑:Linux技術
這篇轉自here
新安裝的Ubuntu在使用sudo apt-get update更新源碼的時候出現如下錯誤:
W: GPG 錯誤:http://ppa.launchpad.net precise Release: 由於沒有公鑰,無法驗證下列簽名: NO_PUBKEY 3EE66BD3F599ACE3
W: GPG 錯誤:http://ppa.launchpad.net precise Release: 由於沒有公鑰,無法驗證下列簽名: NO_PUBKEY 6AF0E1940624A220
W: 無法下載 bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash 校驗和不符

W: 無法下載 bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise-security_main_binary-i386_Packages  Hash 校驗和不符

W: 無法下載 bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages  Hash 校驗和不符

W: 無法下載 bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash 校驗和不符

E: Some index files failed to download. They have been ignored, or old ones used instead.
解決方法很簡單,下載導入公鑰就行,下載導入key的命令如下:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 #此處6AF0E1940624A220需要是錯誤提示的key
此時繼續更新發現沒有公鑰錯誤提示,但是還是效驗存在問題,此時需要打開軟件源的界面,將其他軟件選項中的Canpnical合作伙伴/獨立等四個選項取消勾選,再執行sudo apt-get update
另外送上一個163源,更新的速度挺不錯,品種也挺全的:
# deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release i386 (20120817.3)]/ precise main restricted
   
# Seehttp://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
debhttp://mirrors.163.com/ubuntu/ precise main restricted
deb-srchttp://mirrors.163.com/ubuntu/ precise main restricted
   
## Major bug fix updates produced after the final release of the
## distribution.
debhttp://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-srchttp://mirrors.163.com/ubuntu/ precise-updates main restricted
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
debhttp://mirrors.163.com/ubuntu/ precise universe
deb-srchttp://mirrors.163.com/ubuntu/ precise universe
debhttp://mirrors.163.com/ubuntu/ precise-updates universe
deb-srchttp://mirrors.163.com/ubuntu/ precise-updates universe
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
debhttp://mirrors.163.com/ubuntu/ precise multiverse
deb-srchttp://mirrors.163.com/ubuntu/ precise multiverse
debhttp://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-srchttp://mirrors.163.com/ubuntu/ precise-updates multiverse
   
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
   
debhttp://mirrors.163.com/ubuntu/ precise-security main restricted
deb-srchttp://mirrors.163.com/ubuntu/ precise-security main restricted
debhttp://mirrors.163.com/ubuntu/ precise-security universe
deb-srchttp://mirrors.163.com/ubuntu/ precise-security universe
debhttp://mirrors.163.com/ubuntu/ precise-security multiverse
deb-srchttp://mirrors.163.com/ubuntu/ precise-security multiverse
   
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
debhttp://archive.canonical.com/ubuntu precise partner
deb-srchttp://archive.canonical.com/ubuntu precise partner
   
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
debhttp://extras.ubuntu.com/ubuntu precise main
deb-srchttp://extras.ubuntu.com/ubuntu precise main
   
# codeblock 
debhttp://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
deb-srchttp://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
   
# ubuntu tweak
debhttp://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main
deb-srchttp://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main
遇到的問題:
【缺少公鑰】
現象:
sudo apt-get update
W: GPG error:http://apt.tt-solutions.com dapper Release: 由於沒有公鑰,下列簽名無法進行驗證: NO_PUBKEY 06EA41DE4F6C1E86
解決方法:
gpg --keyserver subkeys.pgp.net --recv 4F6C1E86
gpg --export --armor 4F6C1E86 | sudo apt-key add -
說明:
若缺少其他公鑰,則將命令中兩處4F6C1E86改為NO_PUBKEY
06EA41DE4F6C1E86中最後8位即可!
如果是Ubuntu PPA的則按照如下方法處理:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com

【簽名錯解決辦法】
情況一.概率出現的問題,這次有,可能下次就沒了,可忽略
By simply waiting. This happens at times during archive updates.
情況二.使用如下方法更新:
$ sudo apt-get update -o Acquire::http::No-Cache=True
或者
$ sudo apt-get update -o Acquire::BrokenProxy=true
情況三.
現象:
In a particular case this was caused by a broken file and could get fixed using rescue boot and "fsck -fy /" (http://forum.ubuntuusers.de/goto?post=89197 - german)
解決辦法:
fsck -fy /

情況四:
現象:
The fix is just to back up sources.list, delete everything in it and run "apt-get update". After the update replace sources.list with the backup and run "apt-get update" again. You should not get the error then.

解決辦法:
備份sources.list,然後把sources.list中的東西刪空,運行"apt-get update",然後再用剛剛的備份將"apt-get update"復原,再運行"apt-get update"。
情況五.主旨就是清理緩存
sudo bash
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update

情況六.緩存代理服務器導致的問題:如下內容添加到/etc/apt/apt.conf.d/10broken_proxy文件裡試試看。
Acquire::http::No-Cache "true";
Acquire::http::Max-Age "0";
情況七
sudo apt-get install medibuntu-keyring
Copyright © Linux教程網 All Rights Reserved