When using third party Yum repositories, I often run into a problem with the yum variable $releasever . Scientific Linux uses a version number which is different then what is expected on many third party repositories, which means that I need to go in and make changes to the appropriate /etc/yum.repos.d/*.repo files every time I run into this error.
What is the best way to handle this problem, short of modifying the *.repo every single time? Is this a SL bug? In this example, I am simply trying to get Puppet installed on SL6.4: root@sl6:/etc/yum.repos.d # /usr/bin/yum -q -y install npm http://patches.fedorapeople.org/oldnode/stable/el6.4/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: nodejs-stable. Please verify its path and try again The reason this error occurs is because the repo expects a $releasever variable like '5' or '6' . Visit the repo at http://patches.fedorapeople.org/oldnode/stable/ , and see that it expects strings like 'el6' & 'el5': root@sl6:~ # cat /etc/yum.repos.d/nodejs-stable.repo [nodejs-stable] name=Stable releases of Node.js baseurl= http://patches.fedorapeople.org/oldnode/stable/el$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://patches.fedorapeople.org/oldnode/stable/RPM-GPG-KEY-tchol root@sl6:~ # Compare this against SL, which provides a $releasever like 6.4. Therefore the URL will be appended to be http://patches.fedorapeople.org/oldnode/stable/el6.4/x86_64 , which doesn't exist. root@sl6:~ # python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)' Loaded plugins: fastestmirror, priorities {'arch': 'ia32e', 'basearch': 'x86_64', 'releasever': '6.4', 'uuid': 'a7d2547c-c95c-4577-88e8-eb0b18c89101'} Thank you, -= Stefan -- Stefan Lasiewski Email: stef...@nersc.gov Computer System Engineer III Email: slasiew...@lbl.gov Networking, Security, and Servers Group National Energy Research Scientific Computing Center (NERSC<http://nersc.gov> ) Lawrence Berkeley National Laboratory