Ubuntu16.0.4 unable to resolve host ubuntu: Connection timed out

报错

执行sudo su特别慢,报如下的错误

unable to resolve host ubuntu: Connection timed out

解决方法

查看hostname文件,并记住里面的hostname

cat /etc/hostname

编辑hosts文件

vi /etc/hosts

找到127.0.0.1 localhost这一行将hostname文件中的内容添加到hosts文件中

127.0.0.1	localhost hostname

再次运行sudo su速度快的飞起


参考:https://blog.csdn.net/lxlong89940101/article/details/84615712

猜你喜欢

转载自blog.csdn.net/yh0503/article/details/90599855