Can't sudo in Hardy RC

Asked by Jeff

Forgive the noob question but for whatever reason I cannot sudo anything. See output -

jeff@jeff-laptop:~$ sudo apt-get update
sudo: unable to resolve host jeff-laptop
jeff@jeff-laptop:~$

What am I missing here? Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Max Schukin
Solved:
Last query:
Last reply:
Revision history for this message
Best Max Schukin (schukin) said :
#1

Hi Jeff,

My guess is that you need to edit /etc/hosts.

Restart your computer and choose "Recovery mode" in grub menu.
Then enter:
nano /etc/hosts

The file might look like this:
127.0.0.1 localhost
127.0.0.1 jeff-laptop
127.0.1.1 jeff-laptop.MSHOME

You must comment the line "127.0.1.1 jeff-laptop.MSHOME":
#127.0.1.1 jeff-laptop.MSHOME

If there is no line "127.0.0.1 jeff-laptop" add it.

Now you must have something like this:
127.0.0.1 localhost
127.0.0.1 jeff-laptop
#127.0.1.1 jeff-laptop.MSHOME

To save the file press Ctrl+X and then press Y.

Enter:
reboot

Revision history for this message
Rajinder Sandhu, Bangalore (sandy744-breakthru) said :
#2

if you find it difficult this is a simple solution
go to network manager gui and delete whatever you have given domain name. and close the window it is done

Revision history for this message
Jeff (la3875) said :
#3

SOLVED! Thanks Max.

Revision history for this message
Max Schukin (schukin) said :
#4

You're welcome, Jeff :)