Archlinux安装无法ping通外网问题解决方法

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/killzero/article/details/8857224
         <!--一个博主专栏付费入口结束-->
        <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-d284373521.css">
                                    <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-d284373521.css">
            <div class="htmledit_views" id="content_views">

今晚准备在vmware虚拟机上试着装一个archlinux来玩。

根据wiki上面的教程一步一步做下来,只漏掉了网络配置这一个环节。

结果配置完重启archlinux,发现ping www.baidu.com等等的网站皆显示unknown host.

在执行pacman -Syu或者pacman -Syy的时候,提示


 
 
  1. [greglee@myhost ~]$ sudo pacman -Syu
  2. :: Synchronizing package databases...
  3. error: failed retrieving file 'core.db' from archlinux.mirrors.ovh.net : Could not resolve host: archlinux.mirrors.ovh.net; Name or service not known
  4. error: failed retrieving file 'core.db' from archlinux.mirror.kangaroot.net : Could not resolve host: archlinux.mirror.kangaroot.net; Name or service not known
  5. error: failed retrieving file 'core.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Name or service not known
  6. error: failed retrieving file 'core.db' from ftp.nluug.nl : Could not resolve host: ftp.nluug.nl; Name or service not known
  7. error: failed retrieving file 'core.db' from archlinux.mirror.root.lu : Could not resolve host: archlinux.mirror.root.lu; Name or service not known
  8. error: failed retrieving file 'core.db' from mirror.nl.leaseweb.net : Could not resolve host: mirror.nl.leaseweb.net; Name or service not known
  9. error: failed retrieving file 'core.db' from ftp.halifax.rwth-aachen.de : Could not resolve host: ftp.halifax.rwth-aachen.de; Name or service not known
  10. error: failed retrieving file 'core.db' from mirror.de.leaseweb.net : Could not resolve host: mirror.de.leaseweb.net; Name or service not known
  11. error: failed retrieving file 'core.db' from ftp.uni-kl.de : Could not resolve host: ftp.uni-kl.de; Name or service not known
  12. error: failed retrieving file 'core.db' from archlinux.limun.org : Could not resolve host: archlinux.limun.org; Name or service not known
  13. error: failed to update core (download library error)
  14. error: failed retrieving file 'extra.db' from archlinux.mirrors.ovh.net : Could not resolve host: archlinux.mirrors.ovh.net; Name or service not known
  15. error: failed retrieving file 'extra.db' from archlinux.mirror.kangaroot.net : Could not resolve host: archlinux.mirror.kangaroot.net; Name or service not known
  16. error: failed retrieving file 'extra.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Name or service not known
  17. error: failed retrieving file 'extra.db' from ftp.nluug.nl : Could not resolve host: ftp.nluug.nl; Name or service not known
  18. error: failed retrieving file 'extra.db' from archlinux.mirror.root.lu : Could not resolve host: archlinux.mirror.root.lu; Name or service not known
  19. error: failed retrieving file 'extra.db' from mirror.nl.leaseweb.net : Could not resolve host: mirror.nl.leaseweb.net; Name or service not known
  20. error: failed retrieving file 'extra.db' from ftp.halifax.rwth-aachen.de : Could not resolve host: ftp.halifax.rwth-aachen.de; Name or service not known
  21. error: failed retrieving file 'extra.db' from mirror.de.leaseweb.net : Could not resolve host: mirror.de.leaseweb.net; Name or service not known
  22. error: failed retrieving file 'extra.db' from ftp.uni-kl.de : Could not resolve host: ftp.uni-kl.de; Name or service not known
  23. error: failed retrieving file 'extra.db' from archlinux.limun.org : Could not resolve host: archlinux.limun.org; Name or service not known
  24. error: failed to update extra (download library error)
  25. error: failed retrieving file 'community.db' from archlinux.mirrors.ovh.net : Could not resolve host: archlinux.mirrors.ovh.net; Name or service not known
  26. error: failed retrieving file 'community.db' from archlinux.mirror.kangaroot.net : Could not resolve host: archlinux.mirror.kangaroot.net; Name or service not known
  27. error: failed retrieving file 'community.db' from mir.archlinux.fr : Could not resolve host: mir.archlinux.fr; Name or service not known
  28. error: failed retrieving file 'community.db' from ftp.nluug.nl : Could not resolve host: ftp.nluug.nl; Name or service not known
  29. error: failed retrieving file 'community.db' from archlinux.mirror.root.lu : Could not resolve host: archlinux.mirror.root.lu; Name or service not known
  30. error: failed retrieving file 'community.db' from mirror.nl.leaseweb.net : Could not resolve host: mirror.nl.leaseweb.net; Name or service not known
  31. error: failed retrieving file 'community.db' from ftp.halifax.rwth-aachen.de : Could not resolve host: ftp.halifax.rwth-aachen.de; Name or service not known
  32. error: failed retrieving file 'community.db' from mirror.de.leaseweb.net : Could not resolve host: mirror.de.leaseweb.net; Name or service not known
  33. error: failed retrieving file 'community.db' from ftp.uni-kl.de : Could not resolve host: ftp.uni-kl.de; Name or service not known
  34. error: failed retrieving file 'community.db' from archlinux.limun.org : Could not resolve host: archlinux.limun.org; Name or service not known
  35. error: failed to update community (download library error)
  36. error: failed to synchronize any databases
  37. error: failed to init transaction (download library error)
这个问题让我困扰了很久,在网上找了很多的资料,wiki上面的官方解释是ipv6没有禁用,又或者是源不可用,但是经过我的测试,发现其实是网络根本就没有连通导致的。

最终,终于被我找到了一个解决方案。应该是网络没有自动获取IP.

所以,我的解决方法是,

>nano /etc/rc.conf

在这个文件中添加:

>interface = eth0

保存退出之后,敲入命令

>dhcpcd

马上发现一切正常工作了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值