PDA

View Full Version : [ubuntu] Error using sudo



Wantingtolearn
October 22nd, 2008, 05:35 PM
kmichaellong@kmichaellong-laptop:~$ sudo
sudo: unable to resolve host kmichaellong-laptop
kmichaellong@kmichaellong-laptop:~$

Every time I try to use superuser in terminal, I get this message. What am I doing wrong and how can I fix this? Thank you for you help!!!

stephanvaningen
October 22nd, 2008, 05:38 PM
Hey! Try this:
http://ubuntuforums.org/showthread.php?t=723361
Hope it helps,

fooman
October 22nd, 2008, 05:39 PM
please post the output of:


cat /etc/hosts

Wantingtolearn
October 22nd, 2008, 05:43 PM
I was looking at that thread, but this is what I saw when I did that

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Should I follow the same guidelines?

Thank you!

fooman
October 22nd, 2008, 05:47 PM
i think you may have missed a few lines above "# The following lines are desirable for IPv6 capable hosts"

if they are there...please post.

blazercist
October 22nd, 2008, 05:48 PM
its caused by /etc/hosts your hostname will probably have a .WORKGROUP suffix whihc needs to be removed.

Sarmacid
October 22nd, 2008, 05:48 PM
Run


sudo gedit /etc/hosts

And add this lines at the top of the file


127.0.0.1 localhost
127.0.1.1 kmichaellong-laptop

Wantingtolearn
October 22nd, 2008, 05:52 PM
Sorry, I did miss the top part, I am still very new to this and everyone is very helpful

127.0.0.1 localhost
127.0.1.1 kmichaellong-laptop.domain.com

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Thank you

fooman
October 22nd, 2008, 05:54 PM
well like Sarmacid posted above...try this:


gksudo gedit /etc/hosts

when it opens, change

127.0.1.1 kmichaellong-laptop.domain.com

to:

127.0.1.1 kmichaellong-laptop

save and close the file. that should work.

Sarmacid
October 22nd, 2008, 05:55 PM
Forget my last post. Run


sudo gedit /etc/hosts

And change

kmichaellong-laptop.domain.com
to

kmichaellong-laptop

Bah, fooman beat me to it >_<

Wantingtolearn
October 22nd, 2008, 06:03 PM
I went ahead and did that, but nothing seems to be coming up. I see something that pops up outside of terminal saying, "starting administr..." but terminal just shows a blinking "|" and the tab that pops up saying, "starting administr..." goes away.

No-Neck
October 22nd, 2008, 06:06 PM
sudo nano /etc/hosts?

bodhi.zazen
October 22nd, 2008, 06:17 PM
Well, if the OP has not root access they will need to either boot to recovery mode and use nano or boot a live CD and mount the ubutnu partition from there.

In recovery mode


nano -w /etc/hosts

Add in your changes, Ctrl-X to exit, type Y to save changes

then

telinit 2

Wantingtolearn
October 23rd, 2008, 01:30 AM
I tried that and when I put in the code I see a tab show up that says "starting administr..." then it disappears, and terminal goes to a blinking "|"

bodhi.zazen
October 23rd, 2008, 01:47 AM
What did you try exactly ? Did you boot to recovery mode and edit your /etc/hosts with nano ?

Wantingtolearn
October 23rd, 2008, 02:01 AM
Sorry, I am not sure how to reboot in recovery, I really am a beginner.

bodhi.zazen
October 23rd, 2008, 03:00 AM
Sorry, I am not sure how to reboot in recovery, I really am a beginner.

Reboot Ubuntu. At the boot (grub) screen hit escape. One of the options will be recovery mode. This will boot you to a menu with a list of options. Select I think boot to command line (sorry I forget). This will boot to a command line only, thus nano ;)

tonymoloney
October 23rd, 2008, 03:48 AM
I get the same message, but it doesn't stop me using sudo, so I've just ignored it.