Bash

apt-get update 上的公鑰問題

  • May 17, 2016

我有 Lubuntu 16.04。我的問題類似於這個問題

   sudo apt-get update
   Get:1 http://it.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
   Hit:2 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial InRelease       
   Hit:3 http://it.archive.ubuntu.com/ubuntu xenial-updates InRelease             
   Hit:4 http://it.archive.ubuntu.com/ubuntu xenial-backports InRelease           
   Hit:5 http://www.bchemnet.com/suldr debian InRelease                           
   Hit:6 http://archive.canonical.com xenial InRelease                            
   Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [93,3 kB]    
   Fetched 340 kB in 6s (52,6 kB/s)                                               
   Reading package lists... Done
   W: There is no public key available for the following key IDs:
   FB510D557CC3E840

提供的答案都不是有效的:

  1. 根據這個問題的答案#1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FB510D557CC3E840
Executing: /tmp/tmp.oqit2axEyE/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys FB510D557CC3E840
gpg: requesting key 7CC3E840 from hkp server keyserver.ubuntu.com
gpgkeys: key FB510D557CC3E840 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: key not found
gpg: keyserver communications error: bad public key
gpg: keyserver receive failed: bad public key
  1. 或者這個來自同一個問題,回答#2
sudo apt-get install debian-keyring debian-archive-keyring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
debian-archive-keyring is already the newest version (2014.3).
debian-keyring is already the newest version (2016.01.20).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1. 或者這個來自同一個問題,回答#3
sudo apt-get install debian-archive-keyring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
debian-archive-keyring is already the newest version (2014.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1. 或者這個來自同一個問題,回答#4
for n in `ls /var/lib/apt/lists/*gpg`; do echo "$n" ; gpg --list-packets "$n" | grep FB510D557CC3E840; done
ls: cannot access '/var/lib/apt/lists/*gpg': No such file or directory
  1. 或者這個來自同一個問題,回答#5
sudo apt-get install debian-keyring debian-archive-keyring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
debian-archive-keyring is already the newest version (2014.3).
debian-keyring is already the newest version (2016.01.20).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1. 再試一次,回答這個問題的#1
gpg --keyserver keyserver.ubuntu.com:80 --recv-keys 7CC3E840
gpg: requesting key 7CC3E840 from keyserver.ubuntu.com:80
gpgkeys: no keyserver host provided
gpg: keyserver internal error
gpg: keyserver receive failed: keyserver error
  1. 回答同一問題的第 2 個問題
sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7CC3E840 
gpg: WARNING: unsafe ownership on configuration file `/home/username/.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
  1. 確保權限沒有問題:
ls -l ~/.gnupg/gpg.conf
-rw------- 1 username username 9398 mag 16 15:34 /home/username/.gnupg/gpg.conf
  1. 從最後一個答案
apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys  7CC3E840
Executing: /tmp/tmp.8iRzKu4RVN/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com --recv-keys 7CC3E840
gpg: requesting key 7CC3E840 from hkp server keyserver.ubuntu.com
gpgkeys: key 7CC3E840 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: key not found
gpg: keyserver communications error: bad public key
gpg: keyserver receive failed: bad public key

缺少的密鑰是 Samsung Unified Linux Driver Repository 的密鑰。按照昨天添加到網站的說明應該可以解決問題:

wget http://www.bchemnet.com/suldr/pool/debian/extra/su/suldr-keyring_1_all.deb
sudo dpkg -i suldr-keyring_1_all.deb

(假設您當然信任儲存庫!)。

引用自:https://unix.stackexchange.com/questions/283628