Client Configuration
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 '[epel]' > /etc/yum.repos.d/epel.repo and press Enter
- Type echo 'name=Extra Packages for Enterprise Linux $releasever - $basearch' >> /etc/yum.repos.d/epel.repo and press Enter
- Type echo 'baseurl=http://centos15.box293.local/yumrpms/epel/$releasever/$basearch/' >> /etc/yum.repos.d/epel.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/epel/pki/RPM-GPG-KEY-EPEL-$releasever' >> /etc/yum.repos.d/epel.repo and press Enter
OR paste the following text into a new file /etc/yum.repos.d/epel.repo [epel]
name=Extra Packages for Enterprise Linux $releasever - $basearch
baseurl=http://centos15.box293.local/yumrpms/epel/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://centos15.box293.local/yumrpms/epel/pki/RPM-GPG-KEY-EPEL-$releasever
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 epel Extra Packages for Enterprise Linux 6 - i386 9,982 extras CentOS-6 - Extras 40 updates CentOS-6 - Updates 1,255 repolist: 16,245
OR: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status base/7/x86_64 CentOS-7 - Base 8,652 epel/7/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 9,800 extras/7/x86_64 CentOS-7 - Extras 180 updates/7/x86_64 CentOS-7 - Updates 1,225 repolist: 19,857
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: baseurl=http://centos15.box293.local/yumrpms/epel/6/$basearch/ |