(Possibly) important info:
Ubuntu version - 16.04 LTS
GNU Emacs version - 24.5.1
GNU bash version - 4.3.42(1)-release

I'm trying to edit my apache2.conf file in /etc/apache2/, but using

sudo emacs -mm apache2.conf &

to start Emacs doesn't work. In particular, it doesn't ask me for the root password, and the process just suspends immediately after starting. bg doesn't work either because the process just suspends again.

When starting Emacs as a foreground process instead, I'm asked for the root password, and the process doesn't suspend.

What might be causing this behavior?


This is because sudo meanwhile not works for many GUI based applications, use gksudo instead which you will find in the package gksu. So example:

sudo apt-get install gksu
gksudo emacs -mm apache2.conf &

Happy hacking.

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.