1. mount the disc
[Email protected] ~]# Mkdir/media/centos
[Email protected] ~]# Mount/dev/cdrom/media/centos
2. Enter the /etc/yum.repos.d directory
[Email protected] ~]# cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# MV Centos-base.repo Centos-base.repo.bak
# will be Centos-base.repo change to a backup file so that you can bypass the network for local YUM source installation.
[email protected] yum.repos.d]# CP Centos-media.repo Centos-media.repo.bak
# Backup Centos-media.repo file, we'll edit the file later.
3. Edit the centos-media.repo configuration file
[Email protected] yum.repos.d]# VI Centos-media.repo
# Centos-media.repo
#
# This repo was 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 on your DVD and use it with the other repos too:
# yum--enablerepo=c5-media [command]
#
# or for the media repo, does this:
#
# yum--disablerepo=\*--enablerepo=c5-media [command]
[C5-media]
name=centos-$releasever –media # Custom Name
baseurl=file:///media/centos/# Local CD-Mount Path
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=0 # Check gpg-key,0 to not check , 1 to check
enabled=1 # enabled YUM Source , 0 to not enable , 1 to enable
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
~
4. Execution After configuration is complete
[email protected] yum.repos.d]# Yum Clean All # Clear Yum Source Cache
[[email protected] yum.repos.d]# Yum Update # Update Yum Source
after the update is complete, you can use the local YUM Source to install the appropriate service.
This article is from the "One Meter Sunshine" blog, please be sure to keep this source http://sunshine3.blog.51cto.com/3988340/1616586
CentOS Configuration Local Yum Source--Find a Web tutorial