29

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'
Sathish Kumar
  • 341
  • 1
  • 3
  • 8
  • 1
    I have the same error, did you find anything? – Karel Bílek Aug 14 '17 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 08 '19 at 19:19

1 Answers1

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.

Artem Shelest
  • 104
  • 1
  • 5
  • 7
    I don't have the file `S.gpg-agent.browser` in /root. I am using Debian Stretch 9.1 – Mladen Uzelac Sep 30 '17 at 10:26
  • 13
    @mladen-uzelac Make sure gpg-agent is installed, or install it: `sudo apt-get install gnupg-agent` – Artem Shelest Oct 01 '17 at 11:06
  • I up voted this a while ago, now I came back to up vote your comment – Ordiel Mar 29 '19 at 04:57
  • 5
    Doesn't work for me on Debian Buster/Bullseye, unfortunately. :/ – Per Lundberg Oct 14 '19 at 08: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: – Sam Watkins May 19 '21 at 02:14