sudo geany throws fatal error

5,153

Try deleting this file:

sudo -H rm ~/.config/geany/geany_socket_*

if you want you can move them to some folder temporarily.

Share:
5,153

Related videos on Youtube

dagrha
Author by

dagrha

Updated on September 18, 2022

Comments

  • dagrha
    dagrha over 1 year

    I really like the Geany text editor, and would like to use it instead of gedit for all text editing. However, every time I try to launch Geany from the terminal using sudo geany file.conf, I get this error:

    (geany:10203): Geany-WARNING **: Geany tried to access the Unix Domain socket of another instance running as another user.

    This is a fatal error and Geany will now quit.

    I am the only user logged in to the machine. There are no instances of Geany already running when I type that command into the terminal. Geany has no trouble launching from the command line if I don't use a sudo. I also don't have any trouble running Gedit with elevated privileges; the command sudo gedit file.conf functions flawlessly.

    What is going on here? How can I fix this so that I can edit text files in Geany with elevated privileges?

    • Tim
      Tim over 9 years
      Why are you using sudo?
    • dagrha
      dagrha over 9 years
      I'm using sudo when I want to edit a file that needs elevated privileges; as just one example, /etc/samba/smb.conf
    • DK Bose
      DK Bose over 9 years
      What about gksudo?
    • Tim
      Tim over 9 years
      Right then, as the link above says, use gksudo.
    • dagrha
      dagrha over 9 years
      thanks, gksudo does the trick. why does sudo gedit work-- shouldn't gedit also need the gksudo?
    • Tim
      Tim over 9 years
      It should... Gedit is assuming the user knows to do it right (not use sudo. It is a bad idea on GUI apps...
    • Edward Torvalds
      Edward Torvalds over 9 years
      sudo geany <filename> works fine for me, on ubuntu 14.04
    • Rodrigo
      Rodrigo almost 8 years
      sudo geany <filename> has been working for more than a year. Today I got this error message for the first time.
    • j0h
      j0h almost 7 years
      Why does this error happen, and what can be done to prevent it?
  • doug
    doug over 9 years
    NOTE: sudo geany <filename> works fine on my Ubuntu 14.04 Works & a good idea aren't synonymous
  • Edward Torvalds
    Edward Torvalds over 9 years
    @doug i said that because some people in comment above are advising to use gksudo which may not solve the problem
  • muru
    muru over 9 years
    If you do want to use sudo, at least use sudo -H.
  • Varshaan
    Varshaan about 8 years
    I had same issue manually I did delete the socket file in .cofig/geany and worked for me too thanks :)
  • user568021
    user568021 almost 8 years
    Unbelieveable! I would never solve this on my own!
  • Frank Nocke
    Frank Nocke over 7 years
    @edward-torvalds 'box' seems to be your specific machine name (as in uname -n). One better types sudo -H rm ~/.config/geany/geany_socket_ and then press tab to see, what comes for autocomple (i.e. __<my-machine>__0)