Create local repository for your RHEL/Centos machine

If your RHEL / CentOS machine is not connected to internet but you would like to install packages using yum, then if this is your case, right choice is local repository for your RHEL / CentOS server.

Below is short howto related to this process

To create ISO repository on RH/Centos based distributions follow process

1) Copy DVD .iso image to your server, somewhere where you have enough space

Mount it :

# mkdir -p /mnt/iso
#mount -o loop iso.image /mnt/iso

Find package “creterepo” and install it, if not already installed

( # find /mnt -iname “createrepo*” will do a trick )

After all iso images are mounted, execute

# cd /mnt/

  1. createrepo .

wait, cca 5 min.

Once it finishes, in /etc/yum.repos.d/ create file iso.repo with content

[MyISORepository]
baseurl=file:///mnt
enabled=1

Execute

# yum clean all

# yum list should show list of packages on system

Your new repo is ready for use.

This howto is fine if you have single system, for multiple systems which do not have access to internet / Red Hat Network, the best choice is to install and use Red Hat Satellite / Red Hat Network Proxy

Advertisements

#repository-yum-local-install