Arch Linux卸载软件时不小心将关键依赖一并卸载了。
用LIVE-CD优盘修复系统的时候发现标题所示错误。
Note:请先挂载根分区和启动分区
1 2 3 4 5 |
mount /dev/nvme1n1p2 /mnt mount /dev/nvme1n1p1 /mnt/boot #分区号换成自己的 |
先将以下文件里的国内镜像源去注释,再进行更新
1 2 3 |
vim /etc/pacman.d/mirrorlist #用vim打开 |
更新
1 2 3 |
pacman -Sy |
进行时间同步:
1 2 3 |
timedatactl set-ntp true |
更新keyring:
1 2 3 |
pacman-key --init && pacman-key --populate archlinux |
网上有人是用以下方法解决的
I was stuck with this error for a while. Changed my choice of mirror several times, but still always the error. Finally I ran
123 rm -R /mnt/var/lib/pacman/syncThen the next time I ran pacstrap it worked (using a different mirror than when I originally had the problem). Thanks to https://bbs.archlinux.org/viewtopic.php?id=142798 for suggesting that solution
对我不管用,我是在/etc/pacman.conf里[core]下面添加如下参数
1 2 3 |
SigLevel = Optional TrustAll |
添加后就是这样了
1 2 3 4 5 |
[core] SigLevel = Optional TrustAll Include = /etc/pacman.d/mirrorlist |
之后执行前面的更新命令再安装就可以了,我安装的软件是属于core下的,如果是其他类型的,在对应类型下方添加TrustAll应该也是可以的
最后运行
1 2 3 |
pacstrap /mnt base #或者将base换成自己需要安装的软件 |
成功安装后reboot重启,整个过程不用arch-chroot到/mnt