pacman更新时报错 $arch 未定义

错误信息如下:

[root@arch ~]# pacman -Syy
错误:镜像 'http://mirrors.163.com/archlinux/$repo/os/$arch' 包含可变参数 '$arch' ,但是没有定义 'Architecture'。
错误:无法添加 'http://mirrors.163.com/archlinux/$repo/os/$arch' 镜像到数据库 'core' (未预期的错误)

切换到 LANG=C,英文的报错信息为:

error: mirror 'http://mirrors.163.com/archlinux/$repo/os/$arch' contains the '$arch' variable, but no 'Architecture' is defined.
error: could not add mirror 'http://mirrors.163.com/archlinux/$repo/os/$arch' to database 'archlinuxcn' (unexpected error)


这是因为 /etc/pacman.conf 被改坏了,错误中提示 Architecture 未定义,通过在此文件中的 [options] 段添加定义, Architecture 根据机器具体情况设置,比如 auto,i686, 参见 man pacman.conf

Architecture = auto | i686 | x86_64 | ...

           If set, pacman will only allow installation of packages of the given architecture (e.g.  i686, x86_64, etc). The special

           value auto will use the system architecture, provided via “uname -m”. If unset, no architecture checks are made.  NOTE:

           Packages with the special architecture any can always be installed, as they are meant to be architecture independent.



更改后如下:

[options]
Architecture = x86_64

保存就可以了


参考

转载于:https://my.oschina.net/sukai/blog/600597

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值