Debian: add-apt-repository doesn't find openpgp key and then has exceptions/errors

16,528

As the key is not availaible on the debian key server but on the ubuntu one. Therefore you need to pass an option to query the ubuntu keyserver specifically, then it will work as expected.

The command is : apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886

Share:
16,528

Related videos on Youtube

gheist
Author by

gheist

Updated on September 18, 2022

Comments

  • gheist
    gheist over 1 year

    I installed Debian on my laptop a few days ago. Today I wanted to install Sublime Text 3 and wanted to add their repo to my trusted ones. When entering

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

    in my terminal, I get the following output:

    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'
    

    Also, when I run apt-get update, I get output like this:

    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
    

    Can somebody help me? Thanks!

    • pbhj
      pbhj over 6 years
      The first error looks like the repo doesn't have a GPG key, the file is corrupted or similar and so the add-apt-repository is crapping out. You should be able to visit the repo in your browser, get the files from the pool/ and dpkg -i $PACKAGE the package. The error may indicate the repo has been compromised! The second is saying in /etc/apt/sources.list you have the repo listed on both lines 3 and 5, it's a warning, not an error.
    • gheist
      gheist over 6 years
      The error for the repository occurs on every other repo I want to add, not only the one of Sublime Text. I haven't been able to add a single new repo. Therefore I do not think the repo is compomised, the mistake must be on my computer.
    • pbhj
      pbhj over 6 years
      I suspect you have something corrupt in your binaries or key files that control apt. Have your tried purging and reinstalling sudo apt purge software-properties-common; sudo apt install software-properties-common [add-apt-repos comes from that package]. Do you want to share your apt sources.list file too (eg via pastebin.com if it's long). Also does sudo apt-key list give a big list of keys for all the apt repos you're using?
    • pbhj
      pbhj over 6 years
      I did find a Debian bug report 843946 with the same format. Also another v. similar error in a different package install where the solution appeared to be centred around not trying to install Ubuntu files on a Debian system!
    • gheist
      gheist over 6 years
      @pbhj Yes, I cam eto the same conclusion. The problem were Ubuntu repos that do not work on Debian. I thought since Ubuntu is based on Debian (and I used Mint before Debian) I could simply use the old orders. Thank you for helping me out!
  • bertieb
    bertieb over 5 years
    Thanks, I'll remove my comments as they're no longer needed :)
  • o11c
    o11c over 5 years
    Hm, add-apt-repository also takes a --keyserver argument, but it appears not to work?
  • o11c
    o11c over 5 years
    Maybe it's possible to install the keyring package, but I'm not sure which one ...
  • Per Lundberg
    Per Lundberg over 4 years
    Huge thanks. This helped me add the PPA for podman on Debian buster/bullseye: github.com/containers/libpod/blob/master/…