错误信息如下:
[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
保存就可以了