CentOS / Fedora Core / RHEL 5 uses yum for software management. Yum allows you to add a new repository as a source to install binary software.
Understanding yum repository
yum repository configured using /etc/yum.conf file. Additional configuration files are also read from the directories set by the reposdir option (default is /etc/yum.repos.d and /etc/yum/repos.d.
RPMforge repository
Usually repository carries extra and useful packages. RPMforge is one of such repository. You can easily configure RPMforge repository for RHEL5 just by running following single RPM command:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
For 64 bit RHEL 5 Linux, enter:
# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Now you can install software from RPMforge.
How do I install 3rd party repository manually?
Let us say you would like to install 3rd party repository from foo.nixcraft.com. Create a file called foo:
# cd /etc/yum.repos.d
# vi foo
Append following code:
[foo]
name=Foo for RHEL/ CentOS $releasever - $basearch
baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt
Save and close the file.
Where,
- [foo] : Repository name i.e. The [main] section must exist for yum to do anything.
- name=Foo for RHEL/ CentOS $releasever – $basearch : A human readable string describing the repository name
- baseurl=http://foo.nixcraft.com/centos/$releasever/$basearch/ : Must be a URL to the directory where the yum repository’s ‘repodata’ directory lives
- enabled=1 : Enabled or disabled repo. To disable the repository temporarily, set the enabled to 0
- gpgcheck=1 : Security feature, use GPG key
- gpgkey=http://foo.nixcraft.com/RPM-GPG-KEY.txt : GPL file location
Also you need to import the gpg key for the repository as follows:
# rpm --import http://foo.nixcraft.com/RPM-GPG-KEY.txt
Now you are ready to install software from foo repository. For further information refer to yum.conf man page:
$ man yum.conf
$ man yum
Hope this tip will help you to configure repository as and when required.
See also:
Howto Setup yum repositories to update or install package from ISO CDROM Image
🐧 13 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thanks a lot mate! Great article.
Automation :
$ wget http://foo/bar.repo
# cp bar.repo /etc/yum.repods.d/
# rpm –import $(sed -n -e ‘/gpgkey/ s/.*= *//p’ bar.repo)
Taken from here : http://unix.stackexchange.com/a/84957
Hi Linux fans
I’m using Centos 6 :
Carl
thank you, it’s very useful
Here’s a complete listing of the rpmforge releases.
http://pkgs.repoforge.org/rpmforge-release/
Just go here and find the appropriate one for your box.
Hi Linux fans,
for those who get an error while trying to retrieve the rpm from the address mentioned in this wonderful post, here’s the new one:
http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
Good luck in your Linux endeavors, I hope you will all find it useful in your lives.
Cheers,
Linus
The command line to add the 32bit RH el5 repository for yum is;
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
as of today.
(It would be nice if we could signal the editors to update the command line above to reflect these updates… 😉
Cfn
The new link above is for 86_64 bit I think. where’s the new link for 32 bit?
Looks like they moved the file to another directory. I needed to use this to get it to work…
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Make sure you append.repo to foo. Thanks!
Quite useful, this is what I was look for, You save a lots of time.
Thanks.
Thanks for sharing repoman 🙂
You might also be interested in repoman, which is also available in the Fedora repositories.