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 have an Ubuntu 12.04 fresh installation where I want to change the 'hostname' (machine name'. I have followed several instructions, such as from:

http://www.liberiangeek.net/2011/03/change-hostname-computer-name-ubuntu-11-04-natty/

but all of them end with 'Cannot Open Display' problem. Basically, I have a GUI (desktop) installed. I switch to the Terminal by CTRL ALT F2 key and run commands.

What is happening? Am I missing some package? Note, I can do the stat command on /etc/hostname and /etc/hosts files so perhaps Permissions are okay?

Thanks!

share|improve this question
    
That's pretty old, for 11.04 Natty. I think we have a newer guide around here... let me see if I can find it. –  Seth Feb 19 '13 at 0:04

1 Answer 1

up vote 0 down vote accepted

If you are following that guide it tells you to open gedit. gedit needs a GUI environment to work. So you have two options (personally I don't see why you go to Ctrl+Alt+F2 to get to the terminal, but anyway)

  1. Stay in GUI and run the commands via the gnome-terminal (just press the Windows-key and type terminal)

  2. After pressing Ctrl+Alt+F2, replace "gksu gedit" with "sudo vim" or "sudo nano"

share|improve this answer
    
Doing 'sudo nano' did the trick! ('sudo vim' did not work). And good tip about the Windows to get to the Terminal. Much better. Thank you very much! –  Meengla Feb 18 '13 at 21:40

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.