我只是在VirtualBox中做了一个干净的Fedora 20安装。 我将虚拟机设置为使用NAT作为VirtualBoxnetworkingconfiguration的一部分。
起初,我可以ping google.com,但无法浏览使用Firefox。 当我尝试执行yum update ,出现以下错误:
Loaded plugins: langpacks, refresh-packagekit Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again
然后我在networking设置中禁用了IPv6,并且我也在Firefox中禁用了这个选项。 因此,我可以使用Firefox进行浏览,但在进行yum update时仍然不断收到错误。
当我做URLGRABBER_DEBUG=1 yum check-update我得到:
2013-12-20 11:33:35,612 attempt 1/10: https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64 2013-12-20 11:33:35,612 opening local file "/var/cache/yum/x86_64/20/fedora/metalink.xml.tmp" with mode wb * Adding handle: conn: 0x1c896d0 * Adding handle: send: 0 * Adding handle: recv: 0 * Curl_addHandleToPipeline: length: 1 * - Conn 9 (0x1c896d0) send_pipe: 1, recv_pipe: 0 * Could not resolve host: mirrors.fedoraproject.org * Closing connection 9 2013-12-20 11:33:45,169 exception: [Errno 14] curl#6 - "Could not resolve host: mirrors.fedoraproject.org" 2013-12-20 11:33:45,169 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again
但是,当我做ping mirrors.fedoraproject.org我得到:
ping mirrors.fedoraproject.org PING wildcard.fedoraproject.org (209.132.181.16) 56(84) bytes of data. 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=1 ttl=63 time=104 ms 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=2 ttl=63 time=115 ms 64 bytes from wildcard.fedoraproject.org (209.132.181.16): icmp_seq=3 ttl=63 time=135 ms
nslookup mirrors.fedoraproject.org的结果是:
Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: mirrors.fedoraproject.org canonical name = wildcard.fedoraproject.org. Name: wildcard.fedoraproject.org Address: 209.132.181.16 Name: wildcard.fedoraproject.org Address: 67.203.2.67 Name: wildcard.fedoraproject.org Address: 213.175.193.206 Name: wildcard.fedoraproject.org Address: 140.211.169.197 Name: wildcard.fedoraproject.org Address: 152.19.134.146 Name: wildcard.fedoraproject.org Address: 80.239.156.215 Name: wildcard.fedoraproject.org Address: 66.35.62.166 Name: wildcard.fedoraproject.org Address: 66.135.62.201 Name: wildcard.fedoraproject.org Address: 85.236.55.6
我尝试使用VirtualBox中的桥接适配器选项,但我得到了相同的错误。
我遵循了在NAT模式下启用DNS代理的build议,但同样的问题仍然存在(我仍然可以在Firefox浏览,但yum无法parsing主机mirrors.fedoraproject.org)。 现在ifconfig命令显示这个:
p2p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 fe80::a00:27ff:fea4:a4c6 prefixlen 64 scopeid 0x20<link> ether 08:00:27:a4:a4:c6 txqueuelen 1000 (Ethernet) RX packets 723 bytes 695639 (679.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 628 bytes 77437 (75.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 19 base 0xd020
一个cat /etc/resolv.conf显示这个:
nameserver 10.0.2.3
最后,我尝试了“在NAT模式下使用主机的parsing器作为DNS代理”,问题终于得到解决。
我遵循迈克尔提出的build议,使用这两个步骤:
在NAT模式下启用DNS代理
在NAT模式下使用主机的parsing器作为DNS代理
现在我可以成功浏览和使用yum 。