dist-upgrade changes hostname in /etc/hosts breaking sudo
Bug #178831 reported by
Christian Csar
This bug report is a duplicate of:
Bug #32906: sudo fails if it cannot resolve the local hostname and no MTA is installed.
Edit
Remove
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
I did a dist-upgrade to hardy and part way through sudo would give me a message along the lines of "sudo: unable to resolve host NULL", 'NULL' happens to be my hostname. Following the information here, http://
So instead of "127.0.1.1 NULL" there was "127.0.1.1 <oldhostname>" where <oldhostname> was the name I had set originally.
I was able to go into recovery mode and change this as root, but it was very problematic to say the least since I could not use sudo.
To post a comment you must log in.
I had the same problem with some odd effects.
barcc:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 bluebox.IWNETZ
...
1) After installing sudo 1.6.9p9-1ubuntu1:
barcc:~$ sudo ls
sudo: unable to resolve host System5
barcc:~$ gksudo gedit test&
(nothing happens, i have to do: killall gksudo)
2) With sudo 1.6.8p12-5ubuntu2 there is no problem. Seems to me that the old version ignores /etc/hosts, so the file should be checked when upgrading.
3) With version 1.6.9p9-1ubuntu1 there is no way to become root with one exception:
I started aptitude and selected actions->become root. Then i get the same message, but i can enter my password and then i am root.
barcc:~$ aptitude
sudo: unable to resolve host System5
[sudo] password for barcc:
After leaving aptitude type in the same terminal:
barcc:~$ gksudo gedit test&
The same message occurs, but gedit opens as root
barcc:~$ sudo gedit test
sudo: unable to resolve host System5
(gedit is not opened)
4) After changing /etc/hosts sudo works.
barcc:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 System5
...
I think sudo does not handle the problematic file conformal.