sudo: unable to resolve host [hostname](已解决)

在阿里云服务器上安装Java时报错,于是修改文件/etc/hosts解决。
PS:此时sudo依然可以继续运行。

/etc/hosts原文件如下:

127.0.0.1       localhost

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

在第一行下方加入:

127.0.0.1   [hostname]

AND IT IS OK~��
如果觉得主机名字太奇怪可以修改主机名字,在/etc/hostname里面修改。

猜你喜欢

转载自blog.csdn.net/github_38236333/article/details/78453773