unable to cleanresolve '...

Error message when I run sudo: unable to resolve host (none) - Ask Ubuntu
to customize your list.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. J it only takes a minute:
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I have this issue on AWS on some servers. Whenever I run sudo the terminal is stuck doing seemingly nothing, until it finally spits out this error message. My terminal looks like this:
ubuntu@(none):~$ sudo true
sudo: unable to resolve host (none)
What can I do to solve it?
86.2k26188274
2,73661525
Two things to check (assuming your machine is called my-machine, you can change this as appropriate):
That the /etc/hostname file contains just the name of the machine.
That /etc/hosts has an entry for localhost. It should have something like:
localhost.localdomain localhost
my-machine
If either of these files aren't correct (since you can't sudo), you may have to reboot the machine into recovery mode and make the modifications, then reboot to your usual environment.
30.2k1781134
13.6k13254
/etc/hosts and append your new hostname to the 127.0.0.1 line (or create a new line if you prefer that).
Mine looks like:
localhost localhost.localdomain penguin
# The following lines are desirable for IPv6 capable hosts
ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Replace penguin in the above example by your new hostname as stated in the /etc/hostname file.
93.8k41231307
Note, this is an answer to
which has been merged with this one.
Your hostname (dave00-G31M-ES2L) is not represented in /etc/hosts. Add an L to this line:
dave00-G31M-ES2
So it becomes:
dave00-G31M-ES2L
In order to accomplish this, open a console (press Ctrl+Alt+T) and type:
sudo gedit /etc/hosts
Add the letter L as mentioned, save and exit.
I had this issue when I was using ubuntu on a VPS. I solved it editing /etc/hosts file.
run this command:
sudo nano /etc/hosts
and then add:
localhost.localdomain localhost
I hope that will solve your issue :)
PS: Remember to reboot your computer!
I was having the same issue even though the hostname in my /etc/hostname file and /etc/hosts file matched.
My hostname was "staging_1". It turns out that you can't have an underscore in your hostname, which is why I was getting this error. Changing the underscore to a hyphen fixed my problem.
In AWS, go to your vpc and turn on "DNS Hostnames".
In my case it was the problem, I changed the hostname to man because I wanted to know if there are some parameters you can use on hostname. Instead it changed my hostname to man and I always got the same message like you
sudo: unable to resolve host (none)
after changing the hostname back to `localhost everything worked fine again
hostname localhost
I encountered this same error message. I think this discussion thread at AWS Developer Forums is a better solution:
"Go the the VPC management console, select the VPC, click on Actions, select Edit DNS Hostnames and select Yes."
Some terminal emulators will not update prompt with the correct hostname until you close and restart the emulator (lxterminal, I'm talking to you).
I spent 30min fighting with this error after editing my hostname and hosts files and running sudo service hostname restart until I ran sudo hostname and saw that the hostname was the new value, even though the prompt was showning the old value.
Add your hostname to /etc/hosts like so:
echo $(hostname -I | cut -d\
-f1) $(hostname) | sudo tee -a /etc/hosts
Sorry I can't help you much but, since it says "can't resolve host" try running:
And see if the output is the hostname of the machine. If not, the problem is the host configuration, not sudo.
5,67031633
It was all in /etc/hostname. On two of our sick servers it looked like
ubuntu@(none):~$ cat /etc/hostname
linux-web-n ip-10-128-##-##
While on a server without this issue we had:
ubuntu@ip-10-128-##-###:~$ cat /etc/hostname
ip-10-128-##-###
Removed the linux-web-n portion, rebooted and everything was fine.
First you have to edit the hostname in /etc/hostname file.
Then you have to edit the hostname in /etc/hosts file.
If you type different hostnames in /etc/hostname and /etc/hosts then you will get the error like unable to resolve host.
So you can enter same hostname into the /etc/hostname and /etc/hosts.
After edited, just start the services for hostname sudo service hostname start, then if you check hostname command it will give the new name.
86.2k26188274
you might be getting an error if your hosts or hostname file contain illegal characters. Only these symbols are permitted:
a-z, A-Z, 0-9
I had the same problem. I solved it by editing the /etc/hosts and /etc/hostname files... on the /etc/hosts file, just edit the top part as shown below.
#vi /etc/hosts
myhostname
#vi /etc/hostname
myhostname
86.2k13166243
if you can't sudo you CAN log in as root via su.
IE: su root
(in an x-term).
then give the root password when prompted, then you can edit the files with nano.
The root password in 'buntu is the same as the password you would use for sudo.
I had this same problem! I changed my VPS's name through the online admin control panel which did not change the machine name in the hosts file All I did was run:
sudo nano /etc/hosts
Then I edited it from this:
127.0.1.1 Megabyte Megabyte
127.0.0.1 localhost
127.0.1.1 Debian Debian
127.0.0.1 localhost
and that fixed my error! Hope this helped!
First go to your system file &then etc &then locate the file called hostname. Open it and you'll find a name. It's your machine's name.
Then open the terminal and type >> sudo gedit /etc/hosts. Text editor should open up. There you will find a name in the second line. Replace it with the hostname you already found and save it. Done.
P.S.- Don't edit the numbers in the second line. Edit only the text.
This happens when you messes up with your hosts and hostname.
No worries I myself had this problem and solved it.
Just follow the steps below.
First check your hosts.
For doing so key the following in your terminal:
" cat /etc/hosts " - You should get the following.
""Forget the IPv6 parts and just focus on first 2 lines""
They should look the way I have shown:
If not you have to edit it and for doing so follow the steps given1 below:
Type : sudo gedit /etc/hostname /etc/hosts (in the terminal)
A test editor would open use it to open hosts tab and under remember to edit
localhost.localdomain localhost
second one
127.0.1.1 -to your pc name(Whichever you have kept) .
edit the file under the hosts tab and save it.
You are then good to go.
No need to touch IPv6 settngs.
Please ! Check the link below more explanation about editing /etc/hosts:
Hope this helps.
I searched this over Internet when I myself stumbled over THIS!!!
Now it's solved.
Just change the the host name like your PC in system settings --& details. Change the host name like the name shown in settings.
localhost.localdomain localhost
# The following lines are desirable for IPv6 capable hosts
ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.7k93155
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25534
Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Ask Ubuntu works best with JavaScript enabled2014年6月 移动开发大版内专家分月排行榜第一2014年3月 移动开发大版内专家分月排行榜第一
2014年11月 移动开发大版内专家分月排行榜第二2014年4月 移动开发大版内专家分月排行榜第二2014年2月 移动开发大版内专家分月排行榜第二
本帖子已过去太久远了,不再提供回复功能。

我要回帖

更多关于 unable to clean 的文章

 

随机推荐