6
回答
arch linux pacman -Syu 无法更新
【寻找人气王】邀新用户免费体验华为云服务,百元话费等你拿!   

今天刚刚在Oracle VM VirtualBox 里面安装了Arch Linux

安装完后运行pacman -Syu

但是出现错误:

[root@JeffHost pacman.d]# pacman -Syu
:: Synchronizing package databases...
error: failed retrieving file 'core.db' from mirrors.163.com : No address record
error: failed retrieving file 'core.db' from mirror.bjtu.edu.cn : No address record
error: failed retrieving file 'core.db' from mirror6.bjtu.edu.cn : No address record
error: failed retrieving file 'core.db' from mirrors.ustc.edu.cn : No address record
error: failed retrieving file 'core.db' from mirrors.ustc.edu.cn : No address record
error: failed to update core (No address record)
error: failed retrieving file 'extra.db' from mirrors.163.com : No address record
error: failed retrieving file 'extra.db' from mirror.bjtu.edu.cn : No address record
error: failed retrieving file 'extra.db' from mirror6.bjtu.edu.cn : No address record
error: failed retrieving file 'extra.db' from mirrors.ustc.edu.cn : No address record
error: failed retrieving file 'extra.db' from mirrors.ustc.edu.cn : No address record
error: failed to update extra (No address record)
error: failed retrieving file 'community.db' from mirrors.163.com : No address record
error: failed retrieving file 'community.db' from mirror.bjtu.edu.cn : No address record
error: failed retrieving file 'community.db' from mirror6.bjtu.edu.cn : No address record
error: failed retrieving file 'community.db' from mirrors.ustc.edu.cn : No address record
error: failed retrieving file 'community.db' from mirrors.ustc.edu.cn : No address record
error: failed to update community (No address record)
error: failed to synchronize any databases

接着我尝试ping 百度的 IP (202.108.22.5 )

[root@JeffHost pacman.d]# ping 202.108.22.5
PING 202.108.22.5 (202.108.22.5) 56(84) bytes of data.
64 bytes from 202.108.22.5: icmp_req=1 ttl=49 time=135 ms
64 bytes from 202.108.22.5: icmp_req=2 ttl=49 time=122 ms
64 bytes from 202.108.22.5: icmp_req=4 ttl=49 time=120 ms
64 bytes from 202.108.22.5: icmp_req=6 ttl=49 time=117 ms
64 bytes from 202.108.22.5: icmp_req=7 ttl=49 time=129 ms
64 bytes from 202.108.22.5: icmp_req=10 ttl=49 time=131 ms
64 bytes from 202.108.22.5: icmp_req=11 ttl=49 time=132 ms
64 bytes from 202.108.22.5: icmp_req=12 ttl=49 time=133 ms
64 bytes from 202.108.22.5: icmp_req=13 ttl=49 time=115 ms
^C
--- 202.108.22.5 ping statistics ---
13 packets transmitted, 9 received, 30% packet loss, time 12069ms
rtt min/avg/max/mdev = 115.182/126.579/135.960/7.189 ms

可以看出是ping的通的.

mirrorlist 里面用的是China的地址:

##
## Arch Linux repository mirrorlist
## Generated on 2011-08-16
##
## China
Server = http://mirrors.163.com/archlinux/$repo/os/$arch
Server = http://mirror.bjtu.edu.cn/archlinux/$repo/os/$arch
Server = http://mirror6.bjtu.edu.cn/archlinux/$repo/os/$arch
Server = ftp://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch

arch 版本信息

  • Current Release: 2011.08.19
  • Included Kernel: 3.0.3
  •  

    我百度好久也没解决这个问题,所以到这里请教大家,请问我该怎么解决这个问题?

    举报
    姐夫
    发帖于6年前 6回/5K+阅
    共有6个答案 最后回答: 6年前

    引用来自“JeffYu”的答案

    找到原因了

    原来是静态IP地址,改为"dhcp"就好了

    跟静态或者动态IP没关系,只要是你的DNS没设置对

    $ sudoedit /etc/resolv.conf

    # Google DNS
    NAMESERVER 8.8.8.8
    NAMESERVER 8.8.4.4
    
    # OpenDNS
    NAMESERVER 208.67.222.222
    NAMESERVER 208.67.220.220

    引用来自“吀夜”的答案

    引用来自“JeffYu”的答案

    找到原因了

    原来是静态IP地址,改为"dhcp"就好了

    跟静态或者动态IP没关系,只要是你的DNS没设置对

    $ sudoedit /etc/resolv.conf

    # Google DNS
    NAMESERVER 8.8.8.8
    NAMESERVER 8.8.4.4
    
    # OpenDNS
    NAMESERVER 208.67.222.222
    NAMESERVER 208.67.220.220

    我设置了DNS而且重启了,没有效果,静态地址还是不好更新

    引用来自“JeffYu”的答案

    引用来自“吀夜”的答案

    引用来自“JeffYu”的答案

    找到原因了

    原来是静态IP地址,改为"dhcp"就好了

    跟静态或者动态IP没关系,只要是你的DNS没设置对

    $ sudoedit /etc/resolv.conf

    # Google DNS
    NAMESERVER 8.8.8.8
    NAMESERVER 8.8.4.4
    
    # OpenDNS
    NAMESERVER 208.67.222.222
    NAMESERVER 208.67.220.220

    我设置了DNS而且重启了,没有效果,静态地址还是不好更新

    ifconfig 设置ip,掩码,广播地址
    route 设置路由和网关
    修改/etc/resolv.conf 设置DNS

    手动确实很麻烦,ArchLinux基本安装就有dhcpcd的,开机执行

    # 启动 etch0 网卡
    ifconfig eth0 up
    # 使用dhcpcd后台自己更新DHCP
    dhcpcd eth0

    推荐你安装 wicd,我在archlinux下就用这个,很方便的说.

    这里有安装说明:https://wiki.archlinux.org/index.php/Wicd_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

    ArchLinux的wiki比其他发行版都强大

    引用来自“吀夜”的答案

    引用来自“JeffYu”的答案

    引用来自“吀夜”的答案

    引用来自“JeffYu”的答案

    找到原因了

    原来是静态IP地址,改为"dhcp"就好了

    跟静态或者动态IP没关系,只要是你的DNS没设置对

    $ sudoedit /etc/resolv.conf

    # Google DNS
    NAMESERVER 8.8.8.8
    NAMESERVER 8.8.4.4
    
    # OpenDNS
    NAMESERVER 208.67.222.222
    NAMESERVER 208.67.220.220

    我设置了DNS而且重启了,没有效果,静态地址还是不好更新

    ifconfig 设置ip,掩码,广播地址
    route 设置路由和网关
    修改/etc/resolv.conf 设置DNS

    手动确实很麻烦,ArchLinux基本安装就有dhcpcd的,开机执行

    # 启动 etch0 网卡
    ifconfig eth0 up
    # 使用dhcpcd后台自己更新DHCP
    dhcpcd eth0

    推荐你安装 wicd,我在archlinux下就用这个,很方便的说.

    这里有安装说明:https://wiki.archlinux.org/index.php/Wicd_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

    ArchLinux的wiki比其他发行版都强大

    嗯,谢谢啦
    顶部