Use CentOS DVD1 and DVD2 for local yum Source
CentOS6 and later versions generally provide a DVD1 and a DVD2 image. You can use DVD1 to install and use CentOS. DVD2 stores some additional software packages. This article describes how to create and use a local yum repository.
Merge two DVD images of CentOS 6
1. Related directories:
/Mnt/dvd1 and/mnt/dvd2 are used to mount Centos images.
/Mnt/dvd3 merged image file
/Mnt/iso Storage
Mkdir-p/mnt/dvd1/mnt/dvd2/mnt/dvd3/mnt/iso
2. Upload the Centos image to the server and 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 an object
First, copy all the files in the first DVD to the/mnt/dvd3 directory. Then, only copy all RPM files in the Packages directory of 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. Merge TRANS. TBL
Append the TRANS. TBL information in DVD2 to the end of TRANS. TBL in DVD1, and sort and save the information.
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
Rm-rf/mnt/dvd3/Packages/TRANS. TBL. BAK
Dvd3 is a merged file and can be used as a local source and ISO.
5. Back up the YUM configuration file
Cd/etc/yum. repos. d
Rename. repo. repo. bak *. repo
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
Yum upgrade