27

I am using debian strech. I try to add repostory for vim with python support , while adding I encountered gpg-agent.browser not found error

sudo add-apt-repository ppa:pi-rho/dev
[sudo] password for sathish: 
Dev Packages
More info: https://launchpad.net/~pi-rho/+archive/ubuntu/dev
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keybox '/tmp/tmpxl_vk750/pubring.gpg' created
gpg: /tmp/tmpxl_vk750/trustdb.gpg: trustdb created
gpg: key CC892FC6779C27D7: public key "Launchpad PPA for pi-rho" imported
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.browser'
2
  • 1
    I have the same error, did you find anything? Aug 14, 2017 at 15:09
  • 3
    PPAs are not compatible with Debian, only with Ubuntu and its derivatives like Mint. You can get some to work with some effort, but it's not advisable, especially for someone new to Linux.
    – Mikl
    Apr 8, 2019 at 19:19

1 Answer 1

7

This is how it worked for me:

  1. Look for the file S.gpg-agent.browser, it resides under /root in my system
  2. Login (i.e. su) as root. Update: not necessary, just execute the last item under sudo, it does not change current directory
  3. cd to /root
  4. execute add-apt-repository ppa:pi-rho/dev or sudo add-apt-repository ppa:pi-rho/dev

If execution fails the same way - execute add-apt-repository ppa:pi-rho/dev again.

The point is to execute the script from the directory where it looks for this file. This is a gpg-agent's socket file, agent is started automatically by gpg, but sometimes it takes some time to start, so you need to execute twice.

Of course, there is a right way to fix this issue updating some configuration, but I'm not familiar with linux that much.

5
  • 7
    I don't have the file S.gpg-agent.browser in /root. I am using Debian Stretch 9.1 Sep 30, 2017 at 10:26
  • 11
    @mladen-uzelac Make sure gpg-agent is installed, or install it: sudo apt-get install gnupg-agent Oct 1, 2017 at 11:06
  • I up voted this a while ago, now I came back to up vote your comment
    – Ordiel
    Mar 29, 2019 at 4:57
  • 5
    Doesn't work for me on Debian Buster/Bullseye, unfortunately. :/ Oct 14, 2019 at 8:33
  • I got it to work on Debian testing by installing ubuntu-keyring, running gpg-agent --daemon as root, then installing the ppa. Not sure if installing the keyring was necessary or not. Edit: It's a bit erratic though! Might need to repeat the command. :wtf: May 19, 2021 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.