Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used to be able to do so, but something as simple as this fails now:

gksudo gedit

and this also fails:

sudo gedit

I receive the error:

Cannot open display.

I haved checked this:

  • .Xauthority and .ICEauthority have my user as owner and also read/write permissions
  • As both files are binary, I cannot understand them and check if they are corrupted

Probably, I have some misconfiguration. I have read this before and many other guides before asking.

I'm using Ubuntu Precise 12.04 64-bit.

share|improve this question
Hey, did you manage to solve this? If so, how? – Shrinath Oct 26 '12 at 5:45

You can try executing export DISPLAY=:0 before the command as a workaround.

Or, alternatively, use DISPLAY=:0 gksudo gedit.

share|improve this answer
Thanks for the answer, but it doesn't solve my problem. – Sanete Jul 26 '12 at 10:16

the answers you are locking for are

share|improve this answer
Thanks Boris, I've discovered new tricks. But in my case it doesn't work. Muy user has permissions to sudo. – Sanete Jul 26 '12 at 10:22

Try this in a terminal:

su -

this will ask root password and give a root terminal session, this worked for me, I could run gedit without problems, for example.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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