Execute the following commands on
the CentOS / RHEL client machines that you want to use the local repository.
The configuration file created below uses variables, so it will work with v6 or v7 of CentOS / RHEL and either i386 or x86_64.
- Type echo '[rpmforge]' > /etc/yum.repos.d/rpmforge.repo and press Enter
- Type echo 'name=RHEL $releasever - RPMforge.net - dag' >> /etc/yum.repos.d/rpmforge.repo and press Enter
- Type echo 'baseurl=http://centos15.box293.local/yumrpms/repoforge/redhat/el$releasever/en/$basearch/rpmforge/RPMS/' >> /etc/yum.repos.d/rpmforge.repo and press Enter
- Type echo 'enabled=1' >> /etc/yum.repos.d/epel.repo and press Enter
- Type echo 'gpgcheck=1' >> /etc/yum.repos.d/epel.repo and press Enter
- Type echo 'gpgkey=http://centos15.box293.local/yumrpms/repoforge/pki/RPM-GPG-KEY-rpmforge-dag' >> /etc/yum.repos.d/rpmforge.repo and press Enter
OR paste the following text into a new file /etc/yum.repos.d/rpmforge.repo [rpmforge] name=RHEL $releasever - RPMforge.net - dag baseurl=http://centos15.box293.local/yumrpms/repoforge/redhat/el$releasever/en/$basearch/rpmforge/RPMS/ enabled=1 gpgcheck=1 gpgkey=http://centos15.box293.local/yumrpms/repoforge/pki/RPM-GPG-KEY-rpmforge-dag
This command will show you if the repository was found and will be used:
- Type yum repolist and press Enter
This should output something like: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status base CentOS-6 - Base 4,968 extras CentOS-6 - Extras 40 rpmforge RHEL 6 - RPMforge.net - dag 4,792 updates CentOS-6 - Updates 1,255 repolist: 11,055
OR: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status base/7/x86_64 CentOS-7 - Base 9,007 extras/7/x86_64 CentOS-7 - Extras 265 rpmforge/7/x86_64 RHEL 7 - RPMforge.net - dag 245 updates/7/x86_64 CentOS-7 - Updates 1,405 repolist: 10,922
Can These Be Used With RedHat (RHEL)
Most certainly, there is one change required. In the client config above you will see the following being used: $releasever
On
CentOS this will simply be a number like 5 or 6. In RHEL this might
report as 5Server or 6Server and cause the client config not to work. To
fix this, just use the number instead of the variable, for example: http://centos15.box293.local/yumrpms/repoforge/redhat/el6/en/$basearch/rpmforge/RPMS/ |