1.症状: node
当你是使用sudo来执行命令时,老是在命令执行时,首先输出:“sudo:unable to resolve host Lily-desktop”(假设Lily-desktop 是你的当前主机的名字(host-name)), 可是怎样才能使使用sudo像之前同样不错误提示,正常工做呢。 oop
2.产生该症状的缘由: spa
这种症状常常发生在更改了hostname的情形下。在经过 编辑 /etc/hostname 改变了主机名字(hostname)以后, 咱们还须要改变 /etc/hosts文件的相应部分的内容 code
3.解决方案: router
Solve:
Edit /etc/hosts: // 编辑 /etc/hosts 文件 ip
gksudo gedit /etc/hosts
使粗体字对应的词与当前的主机名即hostname 一致 it
127.0.0.1 localhost 127.0.1.1 Lily-desktop # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts