6

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?

marked as duplicate by Tim, karel, muru, Charles Green, Eric Carvalho Nov 24 '14 at 12:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Why are you using sudo? – Tim Nov 23 '14 at 16:03
  • I'm using sudo when I want to edit a file that needs elevated privileges; as just one example, /etc/samba/smb.conf – dagrha Nov 23 '14 at 16:07
  • 2
    What about gksudo? – DK Bose Nov 23 '14 at 16:08
  • 1
    Right then, as the link above says, use gksudo. – Tim Nov 23 '14 at 16:08
  • thanks, gksudo does the trick. why does sudo gedit work-- shouldn't gedit also need the gksudo? – dagrha Nov 23 '14 at 16:11
15

Try deleting this file:

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

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

  • NOTE: sudo geany <filename> works fine on my Ubuntu 14.04 Works & a good idea aren't synonymous – doug Nov 23 '14 at 23:00
  • @doug i said that because some people in comment above are advising to use gksudo which may not solve the problem – Edward Torvalds Nov 23 '14 at 23:03
  • If you do want to use sudo, at least use sudo -H. – muru Nov 23 '14 at 23:04
  • I had same issue manually I did delete the socket file in .cofig/geany and worked for me too thanks :) – Varshaan Mar 24 '16 at 6:45
  • 3
    @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) – Frank Nocke Jan 14 '17 at 6:50

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