Mount/dev/cdrom/media ## Centos5 # vi/etc/yum. repos. d/CentOS-Base.repo [c5-media] name = CentOS-$ releasever-Mediabaseurl = file: // media/gpgcheck = 1 enabled = 1
Mount/dev/cdrom/media
# Centos5 ##
Vi/etc/yum. repos. d/CentOS-Base.repo
C5-media
Name = CentOS-$ releasever-Media
Baseurl = file: // media/
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
# Gpgcheck = 1 ----> whether to enable check GPG-KEY
# Enabled = 1 ----> whether to enable YUM source
# Pgkey = *** ----> specifies the GPG-KEY file in the Mount Directory
# CentOS_6 ##
Vi/etc/yum. repos. d/CentOS-Media.repo
C6-media
Name = CentOS-$ releasever-Media
Baseurl = file: // media/CentOS/
# Add or modify to the following lines ##
File: // media/
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# CentOS_7 ##
[Cdrom]
Name = CentOS7-cdrom
Baseurl = file: // media/
Enable = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Clear Cache and create new cache
[Root @ localhost ~] # Yum clean all (clear cache)
[Root @ localhost ~] # Yum makecache (new cache)
CentOS_6 build a local disc YUM source
Http://www.centoscn.com/image-text/config/2014/0629/3223.html