Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.