版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
<!--一个博主专栏付费入口结束-->
<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的时候,提示
-
[greglee@myhost ~]$ sudo pacman -Syu
-
:: Synchronizing package databases...
-
error: failed retrieving
file
'core.db' from archlinux.mirrors.ovh.net : Could
not resolve host: archlinux.mirrors.ovh.net;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from archlinux.mirror.kangaroot.net : Could
not resolve host: archlinux.mirror.kangaroot.net;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from mir.archlinux.fr : Could
not resolve host: mir.archlinux.fr;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from ftp.nluug.nl : Could
not resolve host: ftp.nluug.nl;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from archlinux.mirror.root.lu : Could
not resolve host: archlinux.mirror.root.lu;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from mirror.nl.leaseweb.net : Could
not resolve host: mirror.nl.leaseweb.net;
Name
or service
not known
-
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
-
error: failed retrieving
file
'core.db' from mirror.de.leaseweb.net : Could
not resolve host: mirror.de.leaseweb.net;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from ftp.uni-kl.de : Could
not resolve host: ftp.uni-kl.de;
Name
or service
not known
-
error: failed retrieving
file
'core.db' from archlinux.limun.org : Could
not resolve host: archlinux.limun.org;
Name
or service
not known
-
error: failed
to update core (download
library error)
-
error: failed retrieving
file
'extra.db' from archlinux.mirrors.ovh.net : Could
not resolve host: archlinux.mirrors.ovh.net;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from archlinux.mirror.kangaroot.net : Could
not resolve host: archlinux.mirror.kangaroot.net;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from mir.archlinux.fr : Could
not resolve host: mir.archlinux.fr;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from ftp.nluug.nl : Could
not resolve host: ftp.nluug.nl;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from archlinux.mirror.root.lu : Could
not resolve host: archlinux.mirror.root.lu;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from mirror.nl.leaseweb.net : Could
not resolve host: mirror.nl.leaseweb.net;
Name
or service
not known
-
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
-
error: failed retrieving
file
'extra.db' from mirror.de.leaseweb.net : Could
not resolve host: mirror.de.leaseweb.net;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from ftp.uni-kl.de : Could
not resolve host: ftp.uni-kl.de;
Name
or service
not known
-
error: failed retrieving
file
'extra.db' from archlinux.limun.org : Could
not resolve host: archlinux.limun.org;
Name
or service
not known
-
error: failed
to update extra (download
library error)
-
error: failed retrieving
file
'community.db' from archlinux.mirrors.ovh.net : Could
not resolve host: archlinux.mirrors.ovh.net;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from archlinux.mirror.kangaroot.net : Could
not resolve host: archlinux.mirror.kangaroot.net;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from mir.archlinux.fr : Could
not resolve host: mir.archlinux.fr;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from ftp.nluug.nl : Could
not resolve host: ftp.nluug.nl;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from archlinux.mirror.root.lu : Could
not resolve host: archlinux.mirror.root.lu;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from mirror.nl.leaseweb.net : Could
not resolve host: mirror.nl.leaseweb.net;
Name
or service
not known
-
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
-
error: failed retrieving
file
'community.db' from mirror.de.leaseweb.net : Could
not resolve host: mirror.de.leaseweb.net;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from ftp.uni-kl.de : Could
not resolve host: ftp.uni-kl.de;
Name
or service
not known
-
error: failed retrieving
file
'community.db' from archlinux.limun.org : Could
not resolve host: archlinux.limun.org;
Name
or service
not known
-
error: failed
to update community (download
library error)
-
error: failed
to synchronize any databases
-
error: failed
to init transaction (download
library error)
这个问题让我困扰了很久,在网上找了很多的资料,wiki上面的官方解释是ipv6没有禁用,又或者是源不可用,但是经过我的测试,发现其实是网络根本就没有连通导致的。
最终,终于被我找到了一个解决方案。应该是网络没有自动获取IP.
所以,我的解决方法是,
>nano /etc/rc.conf
在这个文件中添加:
>interface = eth0
保存退出之后,敲入命令
>dhcpcd
马上发现一切正常工作了!