Debian:add-apt-repository 找不到 openpgp 密钥,然后出现异常/错误

Debian:add-apt-repository 找不到 openpgp 密钥,然后出现异常/错误

几天前,我在笔记本电脑上安装了 Debian。今天我想安装 Sublime Text 3,并想将其存储库添加到我的信任存储库中。输入

sudo add-apt-repository ppa:webupd8team/sublime-text-3

在我的终端中,我得到以下输出:

gpg: keybox '/tmp/tmpninimrhg/pubring.gpg' created
gpg: /tmp/tmpninimrhg/trustdb.gpg: trustdb created
gpg: key C2518248EEA14886: public key "Launchpad VLC" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no valid OpenPGP data found.
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func
    func(**kwargs)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 386, in add_key
    return apsk.add_ppa_signing_key()
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 273, in add_ppa_signing_key
    cleanup(tmp_keyring_dir)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 234, in cleanup
    shutil.rmtree(tmp_keyring_dir)
  File "/usr/lib/python3.5/shutil.py", line 480, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib/python3.5/shutil.py", line 438, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra'

此外,当我运行时apt-get update,我得到如下输出:

W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:3 and /etc/apt/sources.list:5

有人能帮帮我吗?谢谢!

答案1

由于密钥不在 Debian 密钥服务器上可用,而在 ubuntu 密钥服务器上可用。因此,您需要传递一个选项来专门查询 ubuntu 密钥服务器,然后它才会按预期工作。

命令是: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886

相关内容