linux - 警告 : apt-key is deprecated. 改为在 trust.gpg.d 中管理 key 环文件

标签 linux apt apt-key

我正在按照 this guide 安装 elasticsearch ,但 elasticsearch 并不是这个问题的真正部分。
在第一步中,我需要添加 key :

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
并收到以下消息:
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
安装过程很好,但由于它已被弃用,我正在寻找替代 apt-key 的新用法。 . (我安装软件包没有问题。)来自 man apt-key我看见

apt-key(8) will last be available in Debian 11 and Ubuntu 22.04.

...

Binary keyring files intended to be used with any apt version should therefore always be created with gpg --export.


但它没有说 apt-key add 的替代方案.我试过
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --export
但没有用。那么在wget的管道之后我用什么?当apt-key已移除?

最佳答案

答案在这里找到:
https://suay.site/?p=526
简而言之 :
检索 key 并添加 key :

curl -s URL | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/NAME.gpg --import
授权用户 _apt :
sudo chown _apt /etc/apt/trusted.gpg.d/NAME.gpg

关于linux - 警告 : apt-key is deprecated. 改为在 trust.gpg.d 中管理 key 环文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68992799/

相关文章:

linux - 将文本行保存到数组时出错

c++ - Qt & Raspberry Pi 取终端命令的响应值

docker - apt-key 命令在 shell 上工作,但在 Dockerfile 上失败

linux - 记录过滤

elasticsearch - 安装和运行 elasticsearch 时出现问题

linux - apt-pin 本地构建的包

ruby - 如何在ubuntu中安装指定版本的Ruby

ubuntu - gpg : no valid OpenPGP data found while adding Wazuh repository

linux - 在 tlp 安装期间无法找到软件包 tlp