• Github
  • StackOverflow
  • Linkedin

Tuesday, September 12, 2017

Creating local yum repository using only multiple cdrom iso

This time I will guide you how to install software for CentOS using only ISO cdrom/dvdrom that you'd downloaded from https://wiki.centos.org/Download. This article will save you a lot of times faster rather using online mode. This will install software from its own distributed bundled software from ISO installer of each CentOS version. This methods will works for both newer version and unsupported old CentOS version.

The first thing you need to prepare is your iso files of the CentOS installation cd/dvd. Just follow these steps :
  1. Backup your current yum repos configuration
    [root@localhost ~] tar -zcvf ~/yum.repo.tar.gz /etc/yum.repos.d/*
    
  2. Copy your CentOS iso files to your prefered dir
    [root@localhost ~] cp /media/usb/CentOS-*.iso ~/
    
  3. Create directory for each of iso
    [root@localhost ~] mkdir -p /media/iso/{1,2,3,4,5,6}
    
  4. Mount each of your iso files to those folders
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-1of6.iso /media/iso/1
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-2of6.iso /media/iso/2
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-3of6.iso /media/iso/3
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-4of6.iso /media/iso/4
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-5of6.iso /media/iso/5
    [root@localhost ~] mount -t iso9660 -o loop ~/CentOS-6of6.iso /media/iso/6
    
  5. Install create repo from your mounted iso
    [root@localhost ~] cd /media/iso/5/CentOS
    [root@localhost CentOS] rpm -i createrepo*.noarch.rpm
    
  6. Clean your yum cache
    [root@localhost ~] yum clean all
    
  7. Register your mounted iso directory as repo
    [root@localhost ~] cd /media/iso
    [root@localhost iso] createrepo .
    
  8. Now you can install software as usual (this yum example will install software of yum groupinstall "Development Tools")
    [root@localhost ~] yum install gcc gcc-c++ automake autoconf flex bison pkgconfig rpm-build gettext gdb libtool binutils redhat-rpm-config
    
To make your mounted iso to be available after reboot, edit your /etc/fstab and insert every list of your iso to be mounted at boot.

~/CentOS-5.0-i386-bin-1of6.iso   /media/iso/1  iso9660 loop   0   0
~/CentOS-5.0-i386-bin-2of6.iso   /media/iso/2  iso9660 loop   0   0
~/CentOS-5.0-i386-bin-3of6.iso   /media/iso/3  iso9660 loop   0   0
etc


No comments:

Post a Comment