我正在按照本指南安装elasticsearch ,但elasticsearch实际上并不是这个问题的一部分。
第一步,我需要添加密钥:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)
并收到以下消息:
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Run Code Online (Sandbox Code Playgroud)
安装过程很好,但由于它已被弃用,我正在寻找替代apt-key. (我安装这个包没有问题。)从man apt-key我看到
apt-key(8) 将最后在 Debian 11 和 Ubuntu 22.04 中可用。
...
因此,要与任何 apt 版本一起使用的二进制密钥环文件应始终使用 gpg --export 创建。
但它没有说 的替代方案apt-key add。我试过
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --export
Run Code Online (Sandbox Code Playgroud)
但没有用。wget那么when的管道apt-key拆掉之后我该怎么用呢?
在被弃用之前apt-key,我使用 Ansible playbook 在我的服务器中添加和更新密钥。目前,apt-key不再更新密钥。在几次搜索中,我发现我现在需要使用gpg。但是,我有很多服务器,我不想为每台服务器手动执行此操作。有没有办法用gpgAnsible 管理我的钥匙圈?
以下是我的 Ansible 任务,已弃用apt-key:
- apt_key:
url: "https://packages.treasuredata.com/GPG-KEY-td-agent"
state: present
- apt_repository:
repo: "deb http://packages.treasuredata.com/3/ubuntu/{{ ansible_distribution_release }}/ {{ ansible_distribution_release }} contrib"
state: present
filename: "treasure-data" # Name of the pre-compiled fluentd-agent
Run Code Online (Sandbox Code Playgroud)
我尝试过apt-key update,但它对我不起作用。如果密钥已存在但已过期,则不再更新它。
我正在尝试在 Docker 中使用 Ubuntu 20 或 Ubuntu 22。我的Dockerfile是:
from ubuntu:22.04
run DEBIAN_FRONTEND=noninteractive apt update
Run Code Online (Sandbox Code Playgroud)
我用 构建这个docker build .。结果是:
Sending build context to Docker daemon 2.048kB
Step 1/2 : from ubuntu:22.04
---> 2dc39ba059dc
Step 2/2 : run DEBIAN_FRONTEND=noninteractive apt update
---> Running in b15002ae9dd5
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://security.ubuntu.com/ubuntu jammy-security
InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:4 …Run Code Online (Sandbox Code Playgroud) 我已经按照https://classic.gazebosim.org/tutorials?tut=install_ubuntu中的步骤通过替代安装在我的 ubuntu 22.04 LTS 上安装了 Gazebo。当我尝试使用更新包时出现以下错误sudo apt update
W: http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/jammy/InRelease:密钥存储在旧版的 trusted.gpg 密钥环 (/etc/apt/trusted.gpg) 中,请参阅 apt 中的弃用部分-key(8) 了解详细信息。
我尝试删除密钥,from apt-key list但它给了我额外的警告,提示我无法获取密钥,因为公钥丢失了。有办法解决这个警告吗?
我在警告:apt-key 已弃用中提到了类似的解决方案。改为管理 trust.gpg.d 中的密钥环文件,但无法解决问题。
在shell中运行以下命令似乎有效
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Run Code Online (Sandbox Code Playgroud)
但在执行Dockerfile如下时失败:
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.1CIuj3LUOP/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: cannot open '/dev/tty': No such device or address
Run Code Online (Sandbox Code Playgroud)
特定的DockerfileRUN命令在openjdk:8图像上执行,而图像又从中抽取buildpack-deps:stretch-scm
我按照官方 docker 说明从https://docs.docker.com/install/linux/docker-ce/ubuntu/在 ubuntu 18.04 LTS 上安装 docker
使用我运行的设置存储库:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Run Code Online (Sandbox Code Playgroud)
和
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)
最后
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
Run Code Online (Sandbox Code Playgroud)
然后,运行sudo apt-get update我有错误:
Hit:1 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:3 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:1 http://eu-west-3.ec2.archive.ubuntu.com/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not …Run Code Online (Sandbox Code Playgroud) apt-key ×6
apt ×3
docker ×3
gnupg ×3
ubuntu ×2
ansible ×1
gazebo-simu ×1
tty ×1
ubuntu-18.04 ×1
warnings ×1