Yum sources are mainly divided into network and CD. The configuration file is stored in the/etc/yum. Repo. d directory.
Cat CentOS-Media.repo
# CentOS-Media.repo## This repo is used to mount the default locations for a CDROM / DVD on# CentOS-5. You can use this repo and yum to install items directly off the# DVD ISO that we release.## To use this repo, put in your DVD and use it with the other repos too:# yum --enablerepo=c5-media [command]# # or for ONLY the media repo, do this:## yum --disablerepo=\* --enablerepo=c5-media [command] [c6-media]name=CentOS-$releasever - Mediabaseurl=file:///media/CentOS/ file:///mnt/cdrom/ file:///media/cdrecorder/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Indicates that Yum searches for/Media/centos/,/mnt/CDROM/, And/Media/cdrecorder.
After the disc is inserted, your disc name is displayed in the Meida directory. However, you can use ln instead of the above directories.
Ln-S/Media/disc name/Meida/centos
If the local ISO file is used.
Mkdir/Media/centos
Mount-o loop disc. ISO/Media/centos
After the configuration is complete, you can update the software.
Yum -- disablerepo = * -- enablerepo = c6-media install ****
To update the software.