Ubuntu报错:sudo 无法解析的主机
生活随笔
收集整理的這篇文章主要介紹了
Ubuntu报错:sudo 无法解析的主机
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
剛裝了一個Ubuntu系統(tǒng),系統(tǒng)默認(rèn)的主機(jī)名(hostname)為Ubuntu,我在/etc/hosts中講主機(jī)名由Ubuntu改為master后,在終端上使用sudo命令時,報錯為:sudo 無法解析的主機(jī)。
原因是/etc/hostname中的主機(jī)名和/etc/hosts中的主機(jī)名不一致,當(dāng)時忘了修改/etc/hosts中的主機(jī)名了。
解決方法:
講/etc/hostname中的主機(jī)名和/etc/hosts中的主機(jī)名修改一致。
sudo vim /etc/hosts找到 127.0.0.1 Ubuntu一行,將其中的主機(jī)名Ubuntu修改為master,使/etc/hostname中的主機(jī)名和/etc/hosts中的主機(jī)名保持一致。 source /etc/hosts
總結(jié)
以上是生活随笔為你收集整理的Ubuntu报错:sudo 无法解析的主机的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu 14.04安装chrome
- 下一篇: Ubuntu在当前目录下右键直接打开te