Monday, March 2, 2015

Creating a Local Yum Repository Using an ISO Image


To create a local yum repository (for example, if a system does not have Internet access or don't have valid subscription with Redhat),

1) Copy the iso file to your rhel server for example into /root/installer

cp  /media/dvd/rhel-server-6.5-x86_64-dvd.iso   /root/installer/

2) Mount the iso to a mount point for example /media/dvd

mount -o loop  /root/installer/rhel-server-6.5-x86_64-dvd.iso  /media/dvd

3) Create a repo file /etc/yum.repos.d/dvd.repo, entries may looks like this

[Server]
name=rhel6.5
baseurl=file:///media/dvd/Server
enabled=1
gpgcheck=0

[HighAvailability]
name=rhel6.5
baseurl=file:///media/dvd/HighAvailability
enabled=1
gpgcheck=0

[ResilientStorage]
name=rhel6.5
baseurl=file:///media/dvd/ResilientStorage
enabled=1
gpgcheck=0

[ScalableFileSystem]
name=rhel6.5
baseurl=file:///media/dvd/ScalableFileSystem
enabled=1
gpgcheck=0


4) Save the content and list repo in your rhel server

yum repo list

If everything is ok, you may start installing packages using the repo, for example to install apache web server (httpd)

yum -y install httpd

No comments:

Post a Comment