Cant' use sudo: unable to resolve host ....

Created by marcobra (Marco Braida) on on 2008-05-01
sudo unable to resolve
Last updated by:
marcobra (Marco Braida) on on 2008-05-02


The user cant' use sudo the system show... for example something like this:

dwinningham@dwinningham-laptop:~$ sudo dpkg --configure -a

sudo: unable to resolve host dwinningham-laptop


Seems like this:

Into the /etc/hosts file there must be the computer name
lshw | head -1
give me "ubuntu" is my computer name

and into my /etc/hosts i have: localhost ubuntu ubuntu

So please check yours

You must edit the /etc/hosts file as root but sudo is not working so:

Please Start the pc the when you see the GRUB row...
Press ESC.

Press "e" for edit.

Highlight the line that begins kernel ………, and press "e"

Go to the very end of the line, add rw init=/bin/bash

press enter, then press "b" to boot your system.

Your system will boot up to a passwordless root shell.

You can edit the /etc/hosts file with nano editor type

nano /etc/hosts

to reboot the pc please type


Hope this helps