常见错误

sudo: unable to resolve host [new host name]

错误描述

# 使用sudo时, 提示:
# sudo: unable to resolve host Aliyun

解决方法

# 修改 /etc/hosts
# 在 127.0.0.1 后面添加新更改的主机名称
# 如:

$ cat /etc/hosts
127.0.0.1    localhost Aliyun
127.0.1.1    debug010000002015.local.alipay.net    debug010000002015

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

最后更新于

这有帮助吗?