You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GPG版本冲突求助:已装gnupg2却无法用HTTPS获取密钥

Fix: GnuPG 1.x Can't Fetch Keys Over HTTPS (Even With gnupg2 Installed)

Hey there, let's break down what's happening and how to fix it:

Your system has two versions of GnuPG installed:

  • The old 1.4.20 (linked to the gpg command) which doesn't support HTTPS for key fetching
  • The latest gnupg2 (2.1.11) which does support HTTPS, but it's using the gpg2 command instead of the default gpg

Here are your solutions:

1. Use gpg2 Directly (Quick Fix)

Since you already have the latest gnupg2 installed, just run your key fetch command with gpg2 instead:

gpg2 --fetch-keys https://keys.qubes-os.org/keys/qubes-master-signing-key.asc

This should work immediately because GnuPG 2.x added support for HTTPS key sources.

2. Set gpg2 as the Default gpg (Permanent Fix)

If you want the gpg command to always point to the newer version, use the update-alternatives tool to configure your system's default:

  1. First, check if gpg2 is already in the alternatives list:
update-alternatives --list gpg
  1. If you don't see /usr/bin/gpg2 in the output, add it with a high priority:
sudo update-alternatives --install /usr/bin/gpg gpg /usr/bin/gpg2 100
  1. Now select gpg2 as the default:
sudo update-alternatives --config gpg

You'll see a menu with numbered options—enter the number next to /usr/bin/gpg2 and press Enter.

After this, run gpg --version and you should see the 2.x version. Your original gpg --fetch-keys command will now work over HTTPS.

Bonus Note

GnuPG 1.x is outdated and lacks modern features (like HTTPS support, newer encryption algorithms). It's a good idea to stick with 2.x long-term. If you want to remove the old 1.x package, you can run sudo apt remove gnupg—just double-check that no critical software depends on it first (most modern apps use gnupg2 anyway).

内容的提问来源于stack exchange,提问作者YouHaveaBigEgo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:14:15