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

yum中apt-key的等效工具是什么?AWS AMI部署无头Selenium爬虫适配问题

Equivalent of apt-key for YUM on AWS AMI

Hey there! Since you're working with AWS AMI (which uses YUM/DNF package management instead of Ubuntu's APT), the equivalent tool for handling GPG keys is built right into rpm and YUM itself—no separate apt-key-like standalone tool is needed. Here's how to adapt that initial tutorial step for your system:

1. Import the GPG key directly with rpm

The apt-key add command in Ubuntu adds a key to the system's trusted keyring. For YUM-based systems like AWS AMI, you can use rpm --import to do the exact same job. Modify the tutorial's first command like this:

wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | rpm --import -

This pipes the downloaded Google signing key directly into rpm, which adds it to the system's trusted GPG key database.

2. Alternative: Save the key to YUM's default key directory

YUM automatically looks for trusted keys in /etc/pki/rpm-gpg/. You can download the key to this directory instead, then reference it explicitly in your repo configuration:

wget -q -O /etc/pki/rpm-gpg/RPM-GPG-KEY-google "https://dl-ssl.google.com/linux/linux_signing_key.pub"

When you set up the Google Chrome repo (next step in your workflow), add this line to your .repo file to link to the key:

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-google

Quick note for Amazon Linux 2023 users

If you're on the newer Amazon Linux 2023 release, you'll use dnf instead of yum, but the rpm --import command works exactly the same way. You can also use dnf config-manager to manage repos, but the key handling process stays identical.

Once you've imported the key, you can proceed to create the Google Chrome repo file (in /etc/yum.repos.d/) and install Chrome via yum install google-chrome-stable—just adjust the syntax from the Ubuntu tutorial to fit YUM's workflow.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 10:32:35