[Spacewalk-list] CentOS repos reappear in /etc/yum.repos.d
William H. ten Bensel
WHTENBEN at up.com
Mon Dec 2 16:21:13 UTC 2019
The work around that we found quite helpful is to update /etc/yum.conf,
to point to a different repository directory path. That way if another
repository is added through CentOS or through any other rpm, we do not
have to retrofit or update the kickstart.
We do this with the following kickstart post-script:
mkdir -p /path
grep -qF -- "reposdir=/path" /etc/yum.conf || echo "reposdir=/path" >>
/etc/yum.conf
Thanks and good luck
From: "FRANK Michael" <michael.frank at faurecia.com>
To: "spacewalk-list at redhat.com" <spacewalk-list at redhat.com>
Date: 11/28/2019 11:12 AM
Subject: Re: [Spacewalk-list] CentOS repos reappear in
/etc/yum.repos.d
Sent by: spacewalk-list-bounces at redhat.com
*** STOP. EXTERNAL EMAIL. USE CAUTION ***
Hello,
We do this with the following kickstart post-script:
echo -e "\n############# Removing default CentOS repositories ########\n"
/usr/bin/yum-config-manager --disable base updates extras centosplus
/usr/bin/yum-config-manager --disable cr
/usr/bin/yum-config-manager --disable base-debuginfo
/usr/bin/yum-config-manager --disable fasttrack
/usr/bin/yum-config-manager --disable c7-media
/usr/bin/yum-config-manager --disable base-source updates-source
extras-source centosplus-source
/usr/bin/yum-config-manager --disable C7.0.1406-\*
Which sets all repos to enable=0
After that we do a yum -y update
To test that its persistent I did a quick "yum reinstall
centos-release.x86_64" and the enabled=0 is kept and original repos
didn't showed up
I hope that helps.
BR
Michael
-----Original Message-----
From: spacewalk-list-bounces at redhat.com
<spacewalk-list-bounces at redhat.com> On Behalf Of Brian Long
Sent: Wednesday, November 27, 2019 10:28 PM
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] CentOS repos reappear in /etc/yum.repos.d
Quick-n-dirty kickstart postinstall command we run:
# Disabling CentOS Internet Repos
egrep '^\[.*\]' /etc/yum.repos.d/CentOS-*.repo | awk -F: '{print $2}'
| sed -e 's/\[//g' -e 's/\]//g' | xargs yum-config-manager --disable
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
This electronic transmission (and any attachments thereto) is intended
solely for the use of the addressee(s). It may contain confidential or
legally privileged information. If you are not the intended recipient of
this message, you must delete it immediately and notify the sender. Any
unauthorized use or disclosure of this message is strictly prohibited.
Faurecia does not guarantee the integrity of this transmission and shall
therefore never be liable if the message is altered or falsified nor for
any virus, interception or damage to your system.
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list
**
This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20191202/12be7005/attachment.htm>
More information about the Spacewalk-list
mailing list