Pinterest Stumbleupon Whatsapp
Advertisement

change computer name in ubuntuMakeUseOf has posted free PDF manuals for users interested in switching to Linux because there are many good reasons to 5 Reasons A Disgruntled Windows User Should Consider Using Ubuntu 5 Reasons A Disgruntled Windows User Should Consider Using Ubuntu Read More . The desktop customization options are endless 5 Tools And Tips For A Sexier Ubuntu Interface 5 Tools And Tips For A Sexier Ubuntu Interface Read More , and so it’s not hard to modify bits of your computer, whether you’re in LTS Lucid Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Ubuntu 10.04 - An Extremely Simple Operating System [Linux] Read More (check this post Why Are There So Many Versions of Ubuntu? [Technology Explained] Why Are There So Many Versions of Ubuntu? [Technology Explained] Read More to understand why there are so many different versions of Linux) or Karmic, for which there is a comprehensive and free PDF manual.

Today, we’ll go over a small tip involving how to modify the computer name, which you were able to set when you installed Ubuntu.


You might want to change the computer name for a number of reasons: Perhaps you want to shorten the name, or maybe there was a typo in the old computer name. Whatever it is, be sure to see the following instructions, which were tested in Ubuntu 10.10, a fun OS 6 Fun Ways To Explore Ubuntu 10.10 [Linux] 6 Fun Ways To Explore Ubuntu 10.10 [Linux] Read More which we have explored here What's New In Ubuntu 10.10, "Maverick Meerkat"? [Linux] What's New In Ubuntu 10.10, "Maverick Meerkat"? [Linux] Read More , although these will probably work for 10.04 too. For earlier editions or versions of Ubuntu, check these instructions that don’t require the use of the command line.

  • First, press Alt-F2 to bring up the Run dialog. Type the following:
gksu gedit /etc/hostname
  • and hit Run.

change computer name in ubuntu

  • Type your administrator password when you’re prompted, and click OK. You’ll see a gedit text editor window open, displaying your current computer name. Replace the text with your desired name. Remember to hit Ctrl+S to save your file before closing the file.

ubuntu computer name change

  • Now bring up the Run dialog again by pressing Alt-F2. This time, type:
gksu gedit /etc/hosts

ubuntu computer name change

Advertisement
  • If you get a prompt to type your administrator password, do so to proceed, but it’s possible you might not even get that prompt before the hosts file loads up in gedit. Now locate the last line of the first block of text and replace the text with the name you chose earlier. Hit Save when you’re done correcting.

  • Close the file and restart the system. Once you’re back on your desktop, open a terminal window and verify that you have your new computer name at the header.

ubuntu computer name change

You should be all set if you use Ubuntu’s default web browser, Firefox. If however you use Google Chrome or Chromium, you may receive an error message that prevents the browser from opening after the system restart. I renamed the computer at least twice for this article and only got the error message after the first system renaming test.

ubuntu computer name change

If you did get the error message, read on.

  • To get Google Chrome or Chromium up and running again, bring up the handy Run dialog again and type what’s next:
/home/YOUR_USERNAME/.config/google-chrome
  • OR
/home/YOUR_USERNAME/.config/chromium/

ubuntu computer name change

  • Find and delete the SingletonLock file.

change computer name in ubuntu

  • Open up Google Chrome or Chromium as either one should now run like normal in your freshly-renamed computer.

Additional commenters from all over the web recommend doing “sudo hostname [NEW COMPUTER NAME]” on the terminal, which seems to only tease with a temporary change as the new name is nowhere to be seen after a reboot. I’ve also seen suggestions to restart the hostname service, but that hasn’t worked for me.

Do you know of other ways, perhaps more convenient ones or ones that don’t require a system restart, to change your computer’s name in Ubuntu? Share your nuggets of wisdom in the comments!

Image credit: rafa espada

Leave a Reply

Your email address will not be published. Required fields are marked *