UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just upgraded to hardy, and now anything I try to do using sudo returns "sudo: unable to resolve host <myhostname>" this makes configuring my system a little complicated...
I had the same problem. I had done a fresh clean install of the AMD-64 alternate install version of Ubuntu 8.04 on one partition, while keeping my old copy of Kubuntu 7.10 untouched on another partition for safe keeping. Sudo was still working fine at that point and for several days afterwards.
Here is how I had my system configured when it was still working properly. I installed Ubuntu 8.04 and then used Synaptic to also install the Kubuntu-desktop package. With Kubuntu also installed, I then switched to using KDE, by default, whenever I booted up. I have always done it that way, so that I would have access to several of my favorite Gnome programs and utilities while using KDE. Sudo was still working properly at that point.
The only problem that I had encountered so far was that when running the Firestarter firewall, it would sometimes totally freeze up and had to be terminated. However, that mostly only occurred shortly after having clicked the "Lock Firewall" icon. I had installed Firestarter despite already having a firewall built into my DSL router.
So anyway, I was attempting to figure out how to connect to a shared folder on my other Ubuntu/Kubuntu 8.04 computer, when I suddenly discovered that sudo was not working. Here is the error message:
sudo: unable to resolve host hedgehog
In the above error message, hedgehog is the host name of my computer. So today, I saw your post and the other post which suggested changing the host name of my PC to localhost. While still in KDE, I clicked on the Network option within the System menu, and a "Network Settings" utility appeared. All of the options were grayed out, so clicked on the "Unlock button" and entered my password. I was then able to change my host name to localhost. I logged out and back in and now sudo is working once again.
Since I have a hybrid Ubuntu/Kubuntu system, I am not sure if the above GUI type Nework tool is from the normal Kubuntu installation or from the Ubuntu installation or both. I am not sure if that same exact utility would installed on your normal Ubuntu system under Gnome or not. But anyway, sudo is now working properly for me. Fortunately, when sudo had quit working, the GUI tools for configuring network settings were still able to ask for my password and work properly.
I just found out that Ubuntu Forums has several good discussions about this same problem. They have been saying that the problem is an entry in the hosts file which is located in the /etc/ folder. They have had to manually edit their hosts file to fix the problem. Here is one of those discussions:
Billmayday's suggestion to boot from a live CD to fix the problem sounds like one good way to do that. Bill, did you mistakenly say the fstab file instead of the hosts file? I sometimes forget which is which.
He could boot a live Linux CD and then mount the partition. When doing it that way, a person needs to remember to not edit the /etc/hosts file on the live CD. Instead, they need to edit the hosts file in the etc folder of the partition that Ubuntu is on their hard drive instead.
Bill, did you mistakenly say the fstab file instead of the hosts file? I sometimes forget which is which.
No, but I'm not familiar with the specific problem so I took a guess based on a mounting problem. I'd assume that your solution is correct since it's based on rather more research than mine
I've read the linked posts, rebooted to root & used nano to enter the appropriate lines into my /etc/hosts file, attempted to delete /var/run/sudo/* (nonexistent), can't get gksudo to do anything, my su password comes back "Authentication failure," and I don't have an "Administration" entry in my K > System menu.
Anybody see what I've done wrong or know of anything else?
I think I'm swearing off the *.04 releases after this. I can wait for NTFS -rw support.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.