Friday, December 28, 2012

Setup yum repository from a linux iso shared on remote windows machine

1. Mount remote windows share on linux system

In general, a useful stuff – specially when important software-installers are stored on a windows share. It can be useful to mount the windows share on your linux system to use it efficiently.

Following are the steps:
  • Login to Linux as root user
  • > mkdir /mtn/winshare 
  • > mount -t cifs //<windows-machine-IP-addr>/<folder-path/ -o username=<user>,password=<pw> /mnt/winshare (For RHEL > 4)
  • > mount -t smbfs //<windows-machine-IP-addr>/<folder-path/ -o username=<user>,password=<pw> /mnt/winshare (For RHEL < 4)

2. Extract Files from iso image and create yum repository

  • > mkdir -p /mnt/iso/{1,2,3}
  • > mount -o loop /mnt/winshare/disk.iso /mnt/iso/1
  • > rpm -ivh  /mnt/iso/1/Packages/<createrepo-package-name>.rpm
  • > cd /mnt/iso
  • > createrepo .
  • > yum clean all

3. Create yum repository configuration file

  • > vi /etc/yum.repos.d/iso.repo
  • Place following text in iso.repo
           name=My ISO Repo

Now you should be able to install any package from iso using yum.

- Sarang Anajwala

No comments:

Post a Comment