pacman修复

如果 pacman完全坏掉不能使用,需要手动下载或构建需要的软件包(openssl, libarchive 和 pacman) 并解压到根目录。pacman 会和默认配置文件一起恢复。之后,用 pacman 重新安装这些软件包以保证数据库的完整性。
截图_2019-10-15_08-25-13.png

截图_2019-10-15_08-36-02.png
在根目录解压下载的三个压缩包

例如:openssl

tar -xJvf openssl-1.1.1.d-1-x86_64.pkg.tar.xz
执行:
pacman --version
如果出现报错:
pacman: error while loading shared libraries: libgpgme.so.11: cannot open shared object file: No such file or directory

代表pacman缺少libgpgme.so.11文件

在https://www.archlinux.org/packages/core/x86_64/gpgme/上面下载gpgme

安装gpgme

tar -xvJf gpgme-1.3.1-2-i686.pkg.tar.xz -C / --exclude .PKGINFO --exclude .INSTALL
如果出现报错:
pacman: error while loading shared libraries: libassuan.so.0: cannot open shared object file: No such file or directory
在https://www.archlinux.org/packages/core/x86_64/libassuan/上面下载libassuan

安装libassuan

tar -xvJf libassuan-2.5.3-1-i686.pkg.tar.xz -C / --exclude .PKGINFO --exclude .INSTALL

之后看看缺什么再补什么
参考链接:https://bbs.archlinux.org/viewtopic.php?id=95007&p=2

这时候需要重置密钥
pacman-key --init
==> 错误: 无法找到所需的 gpg 二进制文件以进行所有 pacman-key 操作。

在https://www.archlinux.org/packages/core/x86_64/gnupg/下载gnupg
安装

tar -xvJf gnupg-2.2.17-2-x86_64.pkg.tar.xz -C / --exclude .PKGINFO --exclude .INSTALL

再执行

pacman-key --init
gpg: can't connect to the agent: IPC connect call failed
gpg-agent --daemon
gpg-agent: error while loading shared libraries: libnpth.so.0: cannot open shared object file: No such file or directory

https://www.archlinux.org/packages/core/x86_64/npth/下载npth安装
在执行

gpg-agent --daemon
pacman-key --init

参考链接:https://www.archlinuxcn.org/gnupg-2-1-and-the-pacman-keyring/

pacman-key --populate archlinux

另一种方法就是禁止密钥认证

vim /etc/pacman.conf

修改SigLevel 选项

SigLevel = Never

你可能感兴趣的:(pacman修复)