Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of apt-key in yum?

Tags:

yum

amazon-ami

I am following a tutorial that can be found here to set up a headless selenium scraper on an ec2 instance:

https://krbnite.github.io/Driving-Headless-Chrome-with-Selenium-on-AWS-EC2/

The tutorial I am using seems to assume an ubuntu distro whereas the ec2 instance I am using is an AWS AMI. As such apt-get is not available to me and instead I use yum to install things.

The first step of the installation process is the following:

wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo apt-key add -

When I do this I get the following, to be expected error on my AWS AMI instance:

sudo: apt-key: command not found

I was wondering what the equivalent command would be without using apt, apt-get, or apt-key but instead using yum. I have blindly tried the following but they did not work:

wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo yum add -

wget -q -O - "https://dl-ssl.google.com/linux/linux_signing_key.pub" | sudo yum-key add -

Thanks

like image 796
sometimesiwritecode Avatar asked May 03 '18 00:05

sometimesiwritecode


People also ask

Is yum The same as apt?

Installing is basically the same, you do 'yum install package' or 'apt-get install package' you get the same result. Yum automatically refreshes the list of packages, whilst with apt-get you must execute a command 'apt-get update' to get the fresh packages. Another difference is upgrading all the packages.

What is the equivalent of apt-get on Linux?

Debian's apt-get update fetches and updates the package index. Because I'm used to this way of doing things, I was surprised to find that yum update does all that and upgrades the system.

What is apt-key command?

apt-key is used to manage the list of keys used by apt to authenticate packages. Packages which have been authenticated using these keys will be considered trusted. Note that if usage of apt-key is desired the additional installation of the GNU Privacy Guard suite (packaged in gnupg) is required.


1 Answers

Below is from an article on Baeldung which I think answers this questions properly:

Adding a repository in YUM is a manual operation, which consists in creating a file with the .repo extension under the folder /etc/yum.repos.d.

The file must contain all the information about the custom repository that we are connecting to.

Let’s try adding the AdoptOpenJDK repository:

# /etc/yum.repos.d/adoptopenjdk.repo
[AdoptOpenJDK]
name=AdoptOpenJDK
baseurl=http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/7/$(uname -m)
enabled=1
gpgcheck=1
gpgkey=https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public

In APT, though, things are quite different. The GPG key of the repository must be downloaded and added to the APT keyring with apt-key add:

wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -

Then, at this point, the repository can be added through add-apt-repository –yes followed by the URL:

add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/

Contrary to YUM, all the repositories are saved in a single file, /etc/apt/sources.list.

like image 158
Danial Bagheri Avatar answered Sep 23 '22 10:09

Danial Bagheri