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?

  • Why are you using sudo?
    – Tim
    Nov 23, 2014 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, 2014 at 16:07
  • 2
    What about gksudo?
    – DK Bose
    Nov 23, 2014 at 16:08
  • 1
    Right then, as the link above says, use gksudo.
    – Tim
    Nov 23, 2014 at 16:08
  • thanks, gksudo does the trick. why does sudo gedit work-- shouldn't gedit also need the gksudo?
    – dagrha
    Nov 23, 2014 at 16:11

1 Answer 1


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, 2014 at 23:00
  • @doug i said that because some people in comment above are advising to use gksudo which may not solve the problem Nov 23, 2014 at 23:03
  • If you do want to use sudo, at least use sudo -H.
    – muru
    Nov 23, 2014 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, 2016 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) Jan 14, 2017 at 6:50

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