Thursday, February 6, 2014

making local yum repository

Have you ever run 'yum install' command and got messages like package not found? Or have you run 'yum repolist' and got a 0 result? In that case, you have to mount your yum repository the right way for installing packages the safe way.

What do you need?

You need the .iso image file for your operating system. Here is the step by step process how you should do this.

1. Place your .iso file somewhere on your system, say /home/mine/RHEL.iso
2. mkdir -p /mypath/myName
3. mount -o loop /home/mine/RHEL.iso  mypath/myName
4. do a df -h and you will see the mounted file system [Optional]
5. create a file under /etc/yum.repos.d/myName.repo and edit it the following way:
      name=Red Hat Enterprise Linux
6. yum clean all
7. yum repolist -> This may give the following output:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
repo id                       repo name                                      status
server                        Red Hat Enterprise Linux                       3,529
repolist: 3,529

Now you can do your requisite installations using yum.