1 , related directories:
/MNT/DVD1 and/MNT/DVD2 for mounting Centos mirrors
/mnt/dvd3 merged image file
/mnt/iso ISO Storage
Mkdir-p/mnt/dvd1/mnt/dvd2/mnt/dvd3/mnt/iso
2 , upload the CentOS image to the server, mount the CentOS image file
Mount-o LOOP/MNT/ISO/CENTOS-6.5-X86_64-BIN-DVD1.ISO/MNT/DVD1
Mount-o LOOP/MNT/ISO/CENTOS-6.5-X86_64-BIN-DVD2.ISO/MNT/DVD2
3 , copy files
First, copy all the files from the first DVD to the/MNT/DVD3 directory, and then copy all the rpm files from the Packages directory in the second DVD to the/mnt/dvd3/packages directory.
Cp-av/mnt/dvd1/mnt/dvd3
Cp-v/mnt/dvd2/packages/*.rpm/mnt/dvd3/packages/
4 , merging Trans.tbl
Append the TRANS.TBL information in the DVD2 to the DVD1 trans.tbl, and sort save
Cat/mnt/dvd2/packages/trans. TBL >>/mnt/dvd3/packages/trans. TBL
Mv/mnt/dvd3/packages/{trans. Tbl,trans. TBL. BAK}
Sort/mnt/dvd3/packages/trans. TBL. BAK >/mnt/dvd3/packages/trans. TBL
(Sort sort /mnt/dvd3/packages/trans.) TBL. Bak file, the result is output to /mnt/dvd3/packages/trans. TBL)
Rm-rf/mnt/dvd3/packages/trans. TBL. Bak
dvd3 It is already a merged file and can be used as a local source and as an ISO.
5 , backing up the Yum configuration file
Cd/etc/yum.repos.d
MV *.repo *.repo.bak (* represents repo file name)
6 , generate a new Yum configuration file
Vi/etc/yum.repos.d/centos-media.repo
[C6-media]
Name=centos-\ $releasever-media
Baseurl=file:///mnt/dvd3
Gpgcheck=0
Enabled=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
7 , update yum source
Yum Clean all empties the cache
Yum Upgrade update Yum source
Yum Repolist View the number of Yum source packages
8 , packaging the/mnt/dvd3/as an ISO
Mkisofs-l-j-l-r-v "centos-6.*-x86_64"-o/mnt/iso/centos-6.*-x86_64-dvd.iso/mnt/dvd3
9 , unzip ISO image to use UltraISO, cannot use RAR
Do not know the problem is RAR or the image files caused by the virtual directory files, when using RAR decompression image file, the Repodata folder file *.gz will become a file without suffix, so as a source, will be error. You can add the GZ suffix to each file without any problems. But you can also use UltraISO extracted files are normal with *.gz suffix, it can be used normally.
This article is from the IT Technology Learning blog, so be sure to keep this source http://learningit.blog.51cto.com/9666723/1827972
Centos6 Merge method for two image files