Working with Third Party Repositories on CentOS 6.4
August 26, 2013
I have been playing around with CentOS a bit. It has older versions of all software I use or is missing some other software I need. The first problem (older version of software) is remedied by using additional repositories: Software Collections, IUS. The second problem, missing software, is also remedied by additional repositories: EPEL, RepoForge (formerly RPMForge).
You may want to list your current repositories:
yum repolist
When adding a repository, find the rpm that’ll add/enable the repository. You’ll usually find these on the project’s website. For example, RepoForge, IUS, EPEL have instructions and links on where to find the rpm.
As an example, we’ll add the RepoForge repository.
rpm -ivh 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm'
You could also use yum to install the rpm:
yum localinstall http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
Now when you list the repos on your machine, you’ll see something like:
yum repolist
Loaded plugins: fastestmirror, presto, ps Loading mirror speeds from cached hostfile * base: centos-mirror.jchost.net * epel: mirror.pnl.gov * extras: mirror.ancl.hawaii.edu * rpmforge: apt.sw.be * updates: ftp.usf.edu repo id repo name status base CentOS-6 - Base 6,381 extras CentOS-6 - Extras 13 rpmforge RHEL 6 - RPMforge.net - dag 4,597 updates CentOS-6 - Updates 1,123 repolist: 21,606
To view the packages available from a repository, disable (temporarily) all repos except the one you’re interested in.
yum --disablerepo='*' --enablerepo='rpmforge' list available
To remove a third party repository, first find the rpm and then remove it.
rpm -qa rpmforge*
rpmforge-release-0.5.3-1.el6.rf.x86_64
Or you can use yum:
yum list rpmforge*
If you’re curious to know what the removal will look like, you can test it first.
rpm -e --test -vv rpmforge-release-0.5.3-1.el6.rf.x86_64
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key D: loading keyring from rpmdb D: opening db environment /var/lib/rpm cdb:mpool:joinenv D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 D: locked db index /var/lib/rpm/Packages D: opening db index /var/lib/rpm/Name rdonly mode=0x0 D: read h# 200 Header sanity check: OK D: added key gpg-pubkey-c105b9de-4e0fd3a3 to keyring D: read h# 261 Header sanity check: OK D: added key gpg-pubkey-6b8d79e6-3f49313d to keyring D: Using legacy gpg-pubkey(s) from rpmdb D: read h# 265 Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: OK D: ========== --- rpmforge-release-0.5.3-1.el6.rf x86_64/linux 0x0 D: opening db index /var/lib/rpm/Requirename rdonly mode=0x0 D: ========== recording tsort relations D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth) D: 0 0 0 0 1 -rpmforge-release-0.5.3-1.el6.rf.x86_64 D: erasing packages D: sanity checking 1 elements D: computing 26 file fingerprints D: computing file dispositions D: opening db index /var/lib/rpm/Basenames rdonly mode=0x0 D: 0x0000fd00 4096 121121780 32464498 / D: ========== +++ rpmforge-release-0.5.3-1.el6.rf x86_64-linux 0x0 D: erase: rpmforge-release-0.5.3-1.el6.rf has 26 files, test = 1 D: closed db index /var/lib/rpm/Requirename D: closed db index /var/lib/rpm/Basenames D: closed db index /var/lib/rpm/Name D: closed db index /var/lib/rpm/Packages D: closed db environment /var/lib/rpm
Now you can remove the repo:
rpm -e rpmforge-release-0.5.3-1.el6.rf.x86_64
Or you can use yum:
yum erase rpmforge-release
Additional Resources:
RedHat software collections and CentOS
Recent Comments