It doesn't remove localhost; it removes your local host name (or maybe it mangles it, I can't
remember exactly). So if you name your system "myubuntu", that name is no longer correctly
present in /etc/hosts which means sudo does not allow you to log in.
FYI, here's the Launchpad bug:
https://bugs.launchpad.net/ubuntu/+source/network-manager... Note that I had the
same failure on my system by disabling "roaming mode" in my network config applet and setting
my system to use DHCP. This is all through the GUI, using "supported" methods of configuring
the system. There have been reports that just upgrading to the new release caused this
problem, although I did this on my system at home last night and it worked (I didn't try to
reset the network config though).
There is also a bug reported against sudo for this:
https://bugs.edge.launchpad.net/ubuntu/+source/sudo/+bug/... Contrary to the strident
assertions of folks like asmoore82, I do believe this is a bug, or at the very least an
important enhancement. Or, if not, maybe it's proof that sudo is not the right solution for
Ubuntu. I actually really like this model of no root password / use sudo for everything that
Ubuntu uses... but there should NEVER be a situation where a simple thing like messing up your
/etc/hosts file causes you to no longer be able to log in with administrator privileges and
FIX a problem like messing up your /etc/hosts file. A typo in a file like that should NEVER
require resorting to the rescue disk, mounting a partition by hand, and editing the file to
fix the problem.