1. Place the image CD in centos or find the image file and mount it to the system.
Mount/dev/CDROM/mnt/CDROM #/mnt/CDROM directory must be created first
2. CD/etc/yum. Repos. d/# enter the/etc/yum. Repos. d/directory.
3. mkdir Bak
And move the CentOS-Base.repo and CentOS-Debuginfo.repo to the Bak directory so that local Yum source installation can bypass the network
4. Edit the CentOS-Media.repo configuration file
# CentOS-Media.repo # this repo can be 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 in your DVD and use it with the other repos too: # Yum -- enablerepo = c6-media [command] # Or for only the media Repo, do this: # Yum -- disablerepo = \ * -- enablerepo = c6-media [command] [c6-media] Name = centos-$ releasever-media # custom name baseurl = file: /// MNT/CDROM # Local CD Mount path gpgcheck = 0 # Check GPG-KEY, 0 is not checked, 1 is checked enabled = 1 # enable Yum source, 0 is not enabled, 1 is enabled
4. Run the command after the configuration is complete.
Yum clean all # Clear Yum source Cache
Yum update # update Yum Source
After the update, you can use the local Yum source to install the corresponding service.
Yum install gcc-C ++ # Check whether the command is successful
Configure local Yum source in centos