1.切换到root

sudo su root

2.修改/etc/hosts文件:

sudo vi /etc/hosts

3.在127.0.0.1       localhost下面添加

127.0.0.1 localhost 报错的主机名

4.按Esc,输入

:wq

保存文件并退出。

 

博客参考:

https://yq.aliyun.com/articles/495245

https://blog.csdn.net/hhtnan/article/details/79551969

https://blog.csdn.net/feosun/article/details/73196299