您尚未登录。

#1 2024-05-19 23:16:09

Royi
会员
注册时间: 2024-04-18
帖子: 13

「已解决」GPGME密钥和PGP签名问题

系统:arch
机器:物理机
问题描述:
不知道什么导致的,发生的很突然,因为我没有在任何软件使用上面遇到问题。
我尝试使用pacman安装软件时发现PGP密钥出现了问题:
=================================================================

❯ sudo pacman -Sy archlinux-keyring(安装任何东西都这样)
:: 正在同步软件包数据库...
 core 已经是最新版本
 extra                                     7.8 MiB  1872 KiB/s 00:04 [--------------------------------------] 100%
 multilib 已经是最新版本
 archlinuxcn 已经是最新版本
错误:无法从 mirror.lty.me : SSL connection timeout 获取文件 'core.db'
错误:无法从 mirror.lty.me : SSL connection timeout 获取文件 'extra.db'
错误:无法从 mirror.lty.me : SSL connection timeout 获取文件 'multilib.db'
警告:mirror.lty.me 返回错误过多,将在此事务的剩余部分中跳过
警告:archlinux-keyring-20240429-1 已经为最新 -- 重新安装
正在解析依赖关系...
正在查找软件包冲突...

软件包 (1)              旧版本      新版本      净变化    下载大小

core/archlinux-keyring  20240429-1  20240429-1  0.00 MiB  1.16 MiB

下载大小:      1.16 MiB
全部安装大小:  1.66 MiB
净更新大小:    0.00 MiB

:: 进行安装吗? [Y/n] Y
:: 正在获取软件包......
 archlinux-keyring-20240429-1-any       1191.6 KiB   653 KiB/s 00:02 [--------------------------------------] 100%
(1/1) 正在检查密钥环里的密钥                                         [--------------------------------------] 100%
错误:GPGME 错误:无效的加密引擎
(1/1) 正在检查软件包完整性                                           [--------------------------------------] 100%
错误:GPGME 错误:无效的加密引擎
错误:archlinux-keyring:缺失签名
:: 文件 /var/cache/pacman/pkg/archlinux-keyring-20240429-1-any.pkg.tar.zst 已损坏 (无效或已损坏的软件包 (PGP 签名)).
打算删除吗? [Y/n] n
错误:无法提交处理 (无效或已损坏的软件包 (PGP 签名))
发生错误,没有软件包被更新。

=================================================================

尝试的解决方案:
1. 首先尝试:sudo pacman -S gnupg gpgme,不出意外的爆出了和上面相同的错误:
=================================================================

:: 进行安装吗? [Y/n] Y
(2/2) 正在检查密钥环里的密钥                                         [--------------------------------------] 100%
错误:GPGME 错误:无效的加密引擎
错误:GPGME 错误:无效的加密引擎
(2/2) 正在检查软件包完整性                                           [--------------------------------------] 100%
错误:GPGME 错误:无效的加密引擎
错误:GPGME 错误:无效的加密引擎
错误:gnupg:缺失签名
:: 文件 /var/cache/pacman/pkg/gnupg-2.4.5-1-x86_64.pkg.tar.zst 已损坏 (无效或已损坏的软件包 (PGP 签名)).
打算删除吗? [Y/n] n
错误:gpgme:缺失签名
:: 文件 /var/cache/pacman/pkg/gpgme-1.23.2-4-x86_64.pkg.tar.zst 已损坏 (无效或已损坏的软件包 (PGP 签名)).
打算删除吗? [Y/n] n
错误:无法提交处理 (无效或已损坏的软件包 (PGP 签名))
发生错误,没有软件包被更新。

=================================================================
2. 之后执行sudo pacman -Scc,之后重新下载还是上面的结果

3. 然后我备份了我的~/.gnupg目录,之后删除它,然后执行gpg --refresh-keys,这条命令正常执行(无错误,无输出)
然后执行sudo pacman-key --init && sudo pacman-key --populate archlinux来尝试重置密钥环但是出现了下面的执行结果:

=================================================================

==> 正在生成 pacman 主密钥。这可能需要一段时间。
==> 正在更新可信数据库...
==> 错误: 没有签名可用的私密密钥。
==> 使用 'pacman-key --init' 来生成默认的私密密钥。

=================================================================
并且我的.gnupg文件没有生成。


以上是我做过的所有操作。

现在pacman似乎完全不能用了,有没有大佬帮忙看看怎么解决的?:)万分感谢!!!



更新一下解决方案,为以后来到这里的人提供参考:
经过排查发现是GnuPG这个包出现问题,具体排查方法可以查看下面过程。
以下是解决方案
我的电脑虽然不能使用pacman但是可以正常使用浏览器,直接从浏览器上搜索arch gnupg
在官方仓库(https://archlinux.org/packages/core/x86_64/gnupg/)中的右侧可以选择下载镜像得到官方包,
将该包移动到 /var/cache/pacman/pkg 目录下,之后执行

pacman -U gnupg-2.4.5-1-x86_64.pkg.tar.zst --overwrite '*'

重新安装
之后执行

 sudo pacman-key --init

 sudo pacman-key --populate                                     

大功告成!

最近编辑记录 Royi (2024-05-20 13:28:22)

离线

#2 2024-05-20 08:29:25

keence
会员
注册时间: 2024-02-20
帖子: 42

Re: 「已解决」GPGME密钥和PGP签名问题

离线

#3 2024-05-20 08:31:35

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,849
个人网站

Re: 「已解决」GPGME密钥和PGP签名问题

离线

#4 2024-05-20 10:11:28

Royi
会员
注册时间: 2024-04-18
帖子: 13

Re: 「已解决」GPGME密钥和PGP签名问题

依云 说:

输出结果是这样的:

❯ curl -v [url]https://mirror.lty.me[/url]
* Host mirror.lty.me:443 was resolved.
* IPv6: (none)
* IPv4: 198.18.0.7
*   Trying 198.18.0.7:443...
* Connected to mirror.lty.me (198.18.0.7) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 / x25519 / RSASSA-PSS
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=mirror.lty.me
*  start date: Mar 22 16:41:59 2024 GMT
*  expire date: Jun 20 16:41:58 2024 GMT
*  subjectAltName: host "mirror.lty.me" matched cert's "mirror.lty.me"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
*   Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/2
* [HTTP/2] [1] OPENED stream for [url]https://mirror.lty.me/[/url]
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: mirror.lty.me]
* [HTTP/2] [1] [:path: /]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
> GET / HTTP/2
> Host: mirror.lty.me
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/2 200 
< server: nginx/1.14.2
< date: Mon, 20 May 2024 02:10:39 GMT
< content-type: text/html
< 
<html>
<head><title>Index of /</title></head>
<body bgcolor="white">
<h1>Index of /</h1><hr><pre><a href="../">../</a>
<a href="archlinux/">archlinux/</a>                                         20-May-2024 00:33                   -
</pre><hr></body>
</html>
* Connection #0 to host mirror.lty.me left intact

最近编辑记录 Royi (2024-05-20 11:37:40)

离线

#5 2024-05-20 10:55:53

Royi
会员
注册时间: 2024-04-18
帖子: 13

Re: 「已解决」GPGME密钥和PGP签名问题

这个并不起作用,我查看了官网的wiki,发现了给出的解决的问题的方法并逐一排查:

最新进展

  1. 同步系统时间,我在中国内陆,使用了中国香港的时间,同步之后和我手机上的时间是一样的,我认为没问题

  2. 删除报错的包,这个方法没有作用

  3. 这次我删除了 `/etc/pacman.d/gnupg`然后执行 pacman-key --init 这次成功生成了 gnupg 文件但是似乎也出现了一个报错:

    ❯ sudo pacman-key --init
    chmod: 无法访问 '/etc/pacman.d/gnupg//trustdb.gpg': 没有那个文件或目录
    ==> 正在生成 pacman 主密钥。这可能需要一段时间。
    ==> 正在更新可信数据库...

    ,之后我在想要去执行sudo pacman-key --populate archlinux 重新添加默认密钥的时候,出现了下面的报错:

    ❯ sudo pacman-key --populate archlinux
    ==> 错误: 您没有足够的权限来读取 pacman 密钥环。
    ==> 使用 'pacman-key --init' 更正密钥环许可。

    但是我再次之前已经执行了!我似乎陷入了死循环!

最后一个方法是禁用签名检查,但是我不想这样做。

最近编辑记录 Royi (2024-05-20 11:10:11)

离线

#6 2024-05-20 11:37:28

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,849
个人网站

Re: 「已解决」GPGME密钥和PGP签名问题

看看
sudo bash -x /usr/bin/pacman-key --init

离线

#7 2024-05-20 11:41:39

Royi
会员
注册时间: 2024-04-18
帖子: 13

Re: 「已解决」GPGME密钥和PGP签名问题

依云 说:

看看
sudo bash -x /usr/bin/pacman-key --init

有点复杂:

❯ sudo bash -x /usr/bin/pacman-key --init
+ export TEXTDOMAIN=pacman-scripts
+ TEXTDOMAIN=pacman-scripts
+ export TEXTDOMAINDIR=/usr/share/locale
+ TEXTDOMAINDIR=/usr/share/locale
+ declare -r myver=6.1.0
+ MAKEPKG_LIBRARY=/usr/share/makepkg
+ source /usr/share/makepkg/util/message.sh
++ [[ -n '' ]]
++ LIBMAKEPKG_UTIL_MESSAGE_SH=1
+ source /usr/share/makepkg/util/parseopts.sh
+ ADD=0
+ DELETE=0
+ EDITKEY=0
+ EXPORT=0
+ FINGER=0
+ IMPORT=0
+ IMPORT_TRUSTDB=0
+ INIT=0
+ KEYSERVER=
+ LISTKEYS=0
+ LISTSIGS=0
+ LSIGNKEY=0
+ POPULATE=0
+ RECEIVE=0
+ REFRESH=0
+ UPDATEDB=0
+ USE_COLOR=y
+ VERIFY=0
+ VERBOSE=0
+ type gettext
+ type ngettext
+ OPT_SHORT=adefhlruvV
+ OPT_LONG=('add' 'config:' 'delete' 'edit-key' 'export' 'finger' 'gpgdir:' 'help' 'import' 'import-trustdb' 'init' 'keyserver:' 'list-keys' 'list-sigs' 'lsign-key' 'nocolor' 'populate' 'populate-from:' 'recv-keys' 'refresh-keys' 'updatedb' 'verbose' 'verify' 'version')
+ parseopts adefhlruvV add config: delete edit-key export finger gpgdir: help import import-trustdb init keyserver: list-keys list-sigs lsign-key nocolor populate populate-from: recv-keys refresh-keys updatedb verbose verify version -- --init
+ local opt= optarg= i= shortopts=adefhlruvV
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add ]]
+ [[ add != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n delete ]]
+ [[ delete != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n edit-key ]]
+ [[ edit-key != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n export ]]
+ [[ export != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n finger ]]
+ [[ finger != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n gpgdir: ]]
+ [[ gpgdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n import ]]
+ [[ import != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n import-trustdb ]]
+ [[ import-trustdb != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n init ]]
+ [[ init != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n keyserver: ]]
+ [[ keyserver: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n list-keys ]]
+ [[ list-keys != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n list-sigs ]]
+ [[ list-sigs != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n lsign-key ]]
+ [[ lsign-key != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n populate ]]
+ [[ populate != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n populate-from: ]]
+ [[ populate-from: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n recv-keys ]]
+ [[ recv-keys != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n refresh-keys ]]
+ [[ refresh-keys != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n updatedb ]]
+ [[ updatedb != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verify ]]
+ [[ verify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  1  ))
+ case $1 in
+ IFS==
+ read -r opt optarg
+ longoptmatch init
+ longmatch=()
+ local o longmatch
+ for o in "${longopts[@]}"
+ [[ add = \i\n\i\t ]]
+ [[ add = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ config = \i\n\i\t ]]
+ [[ config = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ delete = \i\n\i\t ]]
+ [[ delete = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ edit-key = \i\n\i\t ]]
+ [[ edit-key = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ export = \i\n\i\t ]]
+ [[ export = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ finger = \i\n\i\t ]]
+ [[ finger = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ gpgdir = \i\n\i\t ]]
+ [[ gpgdir = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ help = \i\n\i\t ]]
+ [[ help = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ import = \i\n\i\t ]]
+ [[ import = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ import-trustdb = \i\n\i\t ]]
+ [[ import-trustdb = \i\n\i\t* ]]
+ for o in "${longopts[@]}"
+ [[ init = \i\n\i\t ]]
+ longmatch=("$o")
+ break
+ case ${#longmatch[*]} in
+ opt=init
+ case $longmatch in
+ return 0
+ case $? in
+ [[ --init = *=* ]]
+ OPTRET+=("--$opt")
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- --init --
+ unset OPT_SHORT OPT_LONG OPTRET
+ [[ --init == \-\- ]]
+ ((  2  ))
+ case $1 in
+ INIT=1
+ shift
+ ((  1  ))
+ case $1 in
+ shift
+ break
+ [[ -t 2 ]]
+ [[ y != \n ]]
+ colorize
+ tput setaf 0
++ tput sgr0
+ ALL_OFF=''
++ tput bold
+ BOLD=''
++ tput setaf 4
+ BLUE=''
++ tput setaf 2
+ GREEN=''
++ tput setaf 1
+ RED=''
++ tput setaf 3
+ YELLOW=''
+ readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
+ type -p gpg
+ ((  (ADD || DELETE || EDITKEY || IMPORT || IMPORT_TRUSTDB || INIT || LSIGNKEY || POPULATE || RECEIVE || REFRESH || UPDATEDB) && EUID != 0  ))
+ CONFIG=/etc/pacman.conf
+ [[ ! -r /etc/pacman.conf ]]
+ KEYRING_IMPORT_DIR=/usr/share/pacman/keyrings
++ pacman-conf --config=/etc/pacman.conf gpgdir
+ PACMAN_KEYRING_DIR=/etc/pacman.d/gnupg/
+ GPG_PACMAN=(gpg --homedir "${PACMAN_KEYRING_DIR}" --no-permission-warning)
+ [[ -n '' ]]
+ numopt=1
+ case $numopt in
+ ((  (ADD || DELETE || EDIT || IMPORT || IMPORT_TRUSTDB ||
		LSIGNKEY || RECEIVE || VERIFY) && 0 == 0  ))
+ ((  ! INIT  ))
+ ((  ADD  ))
+ ((  DELETE  ))
+ ((  EDITKEY  ))
+ ((  EXPORT  ))
+ ((  FINGER  ))
+ ((  IMPORT  ))
+ ((  IMPORT_TRUSTDB ))
+ ((  INIT  ))
+ initialize
+ local conffile keyserv
+ [[ -e /etc/pacman.d/gnupg/ ]]
+ [[ -f /etc/pacman.d/gnupg//pubring.gpg ]]
+ [[ -f /etc/pacman.d/gnupg//secring.gpg ]]
+ [[ -f /etc/pacman.d/gnupg//trustdb.gpg ]]
+ gpg --homedir /etc/pacman.d/gnupg/ --no-permission-warning --update-trustdb
+ chmod 644 /etc/pacman.d/gnupg//pubring.gpg /etc/pacman.d/gnupg//trustdb.gpg
chmod: 无法访问 '/etc/pacman.d/gnupg//trustdb.gpg': 没有那个文件或目录
+ chmod 600 /etc/pacman.d/gnupg//secring.gpg
+ conffile=/etc/pacman.d/gnupg//gpg.conf
+ [[ -f /etc/pacman.d/gnupg//gpg.conf ]]
+ chmod 644 /etc/pacman.d/gnupg//gpg.conf
+ add_gpg_conf_option /etc/pacman.d/gnupg//gpg.conf no-greeting
+ local conffile=/etc/pacman.d/gnupg//gpg.conf
+ shift
+ grep -q '^[[:space:]#]*no-greeting\([[:space:]].*\)*$' /etc/pacman.d/gnupg//gpg.conf
+ add_gpg_conf_option /etc/pacman.d/gnupg//gpg.conf no-permission-warning
+ local conffile=/etc/pacman.d/gnupg//gpg.conf
+ shift
+ grep -q '^[[:space:]#]*no-permission-warning\([[:space:]].*\)*$' /etc/pacman.d/gnupg//gpg.conf
+ add_gpg_conf_option /etc/pacman.d/gnupg//gpg.conf keyserver-options timeout=10
+ local conffile=/etc/pacman.d/gnupg//gpg.conf
+ shift
+ grep -q '^[[:space:]#]*keyserver-options timeout=10\([[:space:]].*\)*$' /etc/pacman.d/gnupg//gpg.conf
+ add_gpg_conf_option /etc/pacman.d/gnupg//gpg.conf keyserver-options import-clean
+ local conffile=/etc/pacman.d/gnupg//gpg.conf
+ shift
+ grep -q '^[[:space:]#]*keyserver-options import-clean\([[:space:]].*\)*$' /etc/pacman.d/gnupg//gpg.conf
++ gpg --version
++ awk '{print $3; exit}'
+ local gpg_ver=
++ vercmp '' 2.2.17
+ ((  -1 >= 0  ))
+ agent_conffile=/etc/pacman.d/gnupg//gpg-agent.conf
+ [[ -f /etc/pacman.d/gnupg//gpg-agent.conf ]]
+ chmod 644 /etc/pacman.d/gnupg//gpg-agent.conf
+ add_gpg_conf_option /etc/pacman.d/gnupg//gpg-agent.conf disable-scdaemon
+ local conffile=/etc/pacman.d/gnupg//gpg-agent.conf
+ shift
+ grep -q '^[[:space:]#]*disable-scdaemon\([[:space:]].*\)*$' /etc/pacman.d/gnupg//gpg-agent.conf
++ secret_keys_available
++ gpg --homedir /etc/pacman.d/gnupg/ --no-permission-warning -K --with-colons
++ wc -l
+ [[ 0 -lt 1 ]]
+ generate_master_key
++ gettext 'Generating pacman master key. This may take some time.'
+ msg '正在生成 pacman 主密钥。这可能需要一段时间。'
+ ((  QUIET  ))
+ local 'mesg=正在生成 pacman 主密钥。这可能需要一段时间。'
+ shift
+ printf '==> 正在生成 pacman 主密钥。这可能需要一段时间。\n'
==> 正在生成 pacman 主密钥。这可能需要一段时间。
+ gpg --homedir /etc/pacman.d/gnupg/ --no-permission-warning --gen-key --batch
+ UPDATEDB=1
+ ((  LISTKEYS  ))
+ ((  LISTSIGS  ))
+ ((  LSIGNKEY  ))
+ ((  POPULATE  ))
+ ((  RECEIVE  ))
+ ((  REFRESH  ))
+ ((  VERIFY  ))
+ ((  UPDATEDB  ))
+ updatedb
++ gettext 'Updating trust database...'
+ msg 正在更新可信数据库...
+ ((  QUIET  ))
+ local mesg=正在更新可信数据库...
+ shift
+ printf '==> 正在更新可信数据库...\n'
==> 正在更新可信数据库...
+ gpg --homedir /etc/pacman.d/gnupg/ --no-permission-warning --batch --check-trustdb
+ exit 0

嗯, 看起来像是gpg的问题,然后我尝试执行

gpg -version

但是没有任何输出,是不是说明我的gpg坏了?这让我想起来了一件事情,我之前用浏览器的时候好像出现了gpg的验证之类的信息,但是我没仔细看之间确定了,然后浏览器就崩溃了,我当时没在意这件事,然后再打开浏览器也能用......

最近编辑记录 Royi (2024-05-20 11:51:56)

离线

#8 2024-05-20 11:59:02

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,849
个人网站

Re: 「已解决」GPGME密钥和PGP签名问题

pacman -Qkk gnupg 检查一下。另外 which gpg 看看是不是 /usr/bin/gpg。

离线

#9 2024-05-20 12:05:48

Royi
会员
注册时间: 2024-04-18
帖子: 13

Re: 「已解决」GPGME密钥和PGP签名问题

依云 说:

pacman -Qkk gnupg 检查一下。另外 which gpg 看看是不是 /usr/bin/gpg。

❯ pacman -Qkk gnupg
错误:读取文件/var/lib/pacman/local/gnupg-2.4.5-1/mtree时发生错误:Unrecognized archive format
gnupg: 没有 mtree 文件
❯ which gpg
/usr/bin/gpg

因为密钥检查有问题,所以我想到了一个办法,先禁用密钥检查重新下载gnupg并且安装,然后再打开密钥检查?这种方法是否可行呢?

离线

#10 2024-05-20 12:23:27

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,849
个人网站

Re: 「已解决」GPGME密钥和PGP签名问题

看来是更新的时候死机/强行关机过。

你的缓存里还有 gnupg 的包吗?你可以把 /var/lib/pacman/local/gnupg-2.4.5-1 删掉然后 pacman -U gnupg包文件 --overwrite '*' 覆盖安装上。
如果没有现成的包文件了的话,你可以手动从信任的地方下载这个版本的包文件,然后参数上一句。

离线

#11 2024-05-20 13:18:07

Royi
会员
注册时间: 2024-04-18
帖子: 13

Re: 「已解决」GPGME密钥和PGP签名问题

依云 说:

看来是更新的时候死机/强行关机过。

你的缓存里还有 gnupg 的包吗?你可以把 /var/lib/pacman/local/gnupg-2.4.5-1 删掉然后 pacman -U gnupg包文件 --overwrite '*' 覆盖安装上。
如果没有现成的包文件了的话,你可以手动从信任的地方下载这个版本的包文件,然后参数上一句。

whooo!!解决了感谢依云大大!!我确实在更新的时候死机过0_0

离线

页脚