April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

How To create a local mirror of latest Red Hat Enterprise Linux without using Satellite server

How To create your own local Red Hat Enterprise Linux yum repository server

To begin, build a virutal machine or stand alone system installing the same OS version of Red Hat you wish to serve as the yum repository. At the time of this writing, my base OS plus mirror data consumed 14G of disk space so be sure to size your disk appropriately. This is necessary as you must register the mirror server to a RHN Satellite, which allows the system to receive software updates. It’s also important to know that one physical system cannot subscribe to multiple architecture base channels. In otherwords, if you install a 64-bit OS, you cannot subscribe to the 32-bit channel.

After the system has been deployed, you’re ready to begin:

Register with RHN
~# rhn_register -vv –nox
Install required packaged
~# yum install createrepo
~# yum install yum-utils
Create a directory for the repo and sync the base channel
~# mkdir /opt/rhel6repo
~# reposync –gpgcheck -l –repoid=rhel-x86_64-server-6 –download_path=/opt/rhel6repo
Note: This will take a long time to run. I ran mine overnight
Create repo data
~# createrepo /opt/rhel6repo
Configure apache to serve the content:
~# vi /etc/httpd/conf.d/rhel-6-repo.conf

Alias /rhel-6-repo /opt/rhel6repo


Options Indexes MultiViews FollowSymLinks
Order allow,deny
Allow from all

Start/restart apache
~# service httpd start

Next, configure the clients by adding the repo to the yum config:

~# cat /etc/yum.repos.d/rhel6.repo
[rhel-6-repo]
name=My Red Hat Enterprise Linux $releasever – $basearch
baseurl=http:///rhel-6-repo
enabled=1
gpgcheck=0

From the client, verify it can see the mirror with yum repolist

You can disable connectivity to Red Hat network by changing the value of enabled = 0 in the file /etc/yum/pluginconf.d/rhnplugin.conf

Clean out the yum cache and remove old header info on the client.

~# yum clean all

Now, you can list all of the updates available from your local mirror.

~# yum list updates

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>