CentOS Configuration local Yum source
1, the system image installed in the optical drive
2. Mount Image
First step: Cd/media
Step two: mkdir cdrom under the Meida directory
Step Three: Mount/dev/cdrom/media/cdrom
3, CD/ETC/YUM.REPOS.D
The following 4 files are available in this directory
Centos-debuginfo.repo
Centos-fasttrack.repo
Centos-media.repo //local source configuration file
Centos-base.repo //Network source configuration file
Centos-vault.repo
The contents of the Centos-media.repo file are as follows:
# Centos-media.repo
#
# This repo can is used with mounted DVD media,verify the mount point for
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# to use this repo,put on your DVD and use it with the other repos too:
# yum--enablerepo=c6-media [command]
#
# or for only themedia repo, does this:
#
# yum--disablerepo=\*--enablerepo=c6-media[command]
[C6-media] //is used to differentiate between different repository and must have a unique name
name=centos-$releasever –media //Description of repository, support for variables like $releasever $basearch
BaseURL is the most important part of the server settings, only the correct settings to obtain the software from above, the URL supports the protocol has http:/ftp://file://three kinds. After BaseURL can be followed by multiple URLs, you can change to a faster mirror station yourself, but BaseURL can only have one
baseurl= file:///media/CentOS/
file:///media/cdrom/ //local CD mount point, configure local Yum source,
file:///media/cdrecorder/
Gpgcheck=1
Enabled=0 //enabled is set to 1 o'clock to enable the local Yum source
gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
4, to configure the local Yum source, you need to disable the network source configuration file, the Yum The network source configuration file is renamed to Centos-base.repo.bak, otherwise the appropriate package is first found in the network source and read directly from the local source after renaming, while modifying the local mount point in the BaseURL in Centos-media.repo and setting the enabled parameter to 1
CentOS Configuration local Yum source