Issue
I am in a situation where I need to point to an internally hosted yum repo and update specific packages found in those repos. There are two repos, one for Red Hat 5.x and the other for Red Hat 6.x.
Before you ask, I can't add the repos through the normal method as that requires upstream changes which I am not allowed to make. (That would be too simple!) Hence, why I am asking how to run a simple shell script, and tell yum to point to the RHEL 5.x repo for a specific package and upgrade to the latest package found there. This is for security patching.
The sad way I am doing this now is to run a pssh loop against a bunch of machines where I know they are all RHEL 5 or 6, and run a yum update -y http://RHEL5/package-version-arch.rpm. But this is much harder to accomplish in a simple way if there is a mix of machines as then I'd have to point to different repos based the OS version, and also find the full RPM file names.
Any ideas?
Solution
Try using yum's -c switch to provide an alternate config file, presumably with reposdir set to an empty directory and a [repository]
section giving the name and baseurl of your desired repo. The -c switch can even be given a url instead of a local filename.
Answered By - ysth Answer Checked By - Pedro (WPSolving Volunteer)