November 20, 2015

How To: mount ISO image as yum repository

This post is just a quick how to reference about how to mount an ISO image contains Oracle Linux Installation Binaries and use that as a YUM repository to install/update the operating system.

 -- This is a Oracle Linux 6.7 ISO image downloaded from eDelivery.  
 [root@pxe-yum ~]# ls -ltr /tftpboot/OL6.7.iso/V77197-01.iso  
 -rw-r----- 1 root root 3914334208 Nov 16 13:21 /tftpboot/OL6.7.iso/V77197-01.iso  
 -- First, create the required mount point  
 # mkdir -p /var/www/html/OL6.7  
 -- Mount the file manually using the following command  
 # mount -o loop /tftpboot/OL6.7.iso/V77197-01.iso /var/www/html/OL6.7  
 OR  
 -- Add the following entry into the /etc/fstab  
 [root@pxe-yum ~]# cat /etc/fstab | grep OL6.7  
 /tftpboot/OL6.7.iso/V77197-01.iso /var/www/html/OL6.7 udf,iso9660 user,loop 0 0  
 -- Mount the ISO image  
 [root@pxe-yum ~]# mount /var/www/html/OL6.7  
 -- Create a yum repo file as below  
 File: /etc/yum.repos.d/LOCAL-yum-ol6.repo  
 [LOCAL_ol67_iso]  
 name=Oracle Linux 6.7 BASE ISO  
 baseurl=file:///var/www/html/OL6.7  
 gpgcheck=0  
 enabled=1  
 -- Validate the repository  
 [root@pxe-yum ~]# yum list --disablerepo=* --enablerepo=LOCAL_ol67_iso    
-- Now you will be able to install/update packages as required, below is just an example  
 [root@pxe-yum ~]# yum --disablerepo=* --enablerepo=LOCAL_ol67_iso install <package_name>  

3 comments:

  1. Spot on! exactly what am looking for.

    wiki

    ReplyDelete
  2. Hi, guys!
    Here is really good explanation how to accomplish the task
    http://dbpilot.net/2018/02/06/creating-a-local-yum-repository-using-an-iso-image/
    http://dbpilot.net/2018/02/06/creating-a-local-yum-repository/
    http://dbpilot.net/2018/02/05/caching-all-packages-after-yum-has-installed-it/
    http://dbpilot.net/2018/02/05/downloading-a-package-without-installing-it/

    ReplyDelete
  3. It is really a helpful blog to find some different source to add my knowledge. ISO UAE TRAINING

    ReplyDelete