sudo: unable to resolve host myhostname: Connection timed out

 

第一种

原因,/etc/hostname 中的hostname 与/etc/hosts 里面的不对应,导致无法解析

将两个文件的hostname改成一样的即可。

/etc/hostname      

aaa

/etc/hosts

127.0.0.1       localhost
本机IP           aaa

 

第二种

或者:/etc/hosts

在127.0.0.1 localhost 后面加上主机名称(hostname) 即可:

127.0.0.1       localhost abc

posted @ 2018-11-12 19:35  anobscureretreat  阅读(513)  评论(0编辑  收藏  举报