dev-resources.site
for different kinds of informations.
Advanced usage of yum-config-manager with setopts
Published at
8/8/2019
Categories
centos
mysql
yum
ansible
Author
rndmh3ro
Author
8 person written this
rndmh3ro
open
Recently I used the yum-config-manager program from the yum-utils package to add a repository in a CentOS-box.
This is the easy part:
# install the yum-config-manager
yum -y install yum-utils
# add the official ansible repository
yum-config-manager --add-repo=https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
What gets added in /etc/yum.repos.d/
is a file with the following content:
[releases.ansible.com_ansible_rpm_release_epel-7-x86_64_]
name=added from: https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
baseurl=https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
enabled=1
Now how to set for example the gpg-key with this command? That’s trickier.
The man-page for yum says you should use --setopt
to “set arbitrary config and repo options”. man yum-config-manager
goes into a little more detail:
Set any config option in yum config or repo files. For options
in the global config just use: --setopt=option=value for repo
options use: --setopt=repoid.option=value. The latter form
accepts wildcards in repoid that will be expanded to the
selected sections. If repoid contains no wildcard, it will
automatically be selected; this is useful if you are
addressing a disabled repo, in which case you don't have to
additionally pass it as an argument.
So to set the gpg-key for the repository I created before, I had to use this command:
yum-config-manager --save --setopt=releases.ansible.com_ansible_rpm_release_epel-7-x86_64_.gpgkey=https://releases.ansible.com/keys/RPM-GPG-KEY-ansible-release.pub
yum Article's
11 articles in total
The best carb.js
read article
Setting up a VPC Endpoint for yum with AWS CDK
read article
recover from a interrupted yum upgrade
read article
YUM/DNF ile Depo İşlemleri
read article
Your own local repository.
read article
Dependency hell in Linux (centos 7)
read article
python3 yum
read article
ERROR: Existing lock /var/run/yum.pid: another copy is running as pid <PID>
read article
Advanced usage of yum-config-manager with setopts
currently reading
How to do Security Updates only with Yum in CentOS
read article
Why do we ❤️ Oracle Linux 7 and node 10 ?
read article
Featured ones: