Yum Local Source configurationTags: centosplugins network file virtual machine Linux2011-10-09 21:40 12093 People read Comments (1) favorite reports Classification:Linux Yum
On the internet to find a lot for the CentOS 6 configuration local Yum source method, many of which are related to the network, I just want to match their own use, the results found that this method is relatively simple and practical, and turned around.
Environment: CentOS 6.0
The default yum is installed on the network, it is very painful to install the software through Yum without a network or poor speed. In fact, for the CentOS DVD, the software provided is sufficient to meet our needs, and the software version of the DVD is stable version, download speed is fast, for learning CentOS, the CentOS DVD as the default Yum source can greatly improve the learning efficiency.
1. Create a mount directory for the DVD
[Email protected] ~]# Mkdir/media/centos
2. Mount the CentOS DVD under Linux (virtual machine Mount DVD Not said, should be)
[Email protected] ~]# mount-t Auto/dev/cdrom/media/centos
3, view the relevant configuration file, directory for
[Email protected] ~]# ls-l/etc/yum.repos.d/
-rw-r--r--. 1 root root 1926 July 3 10:15 Centos-base.repo
-rw-r--r--. 1 root root 637 July 3 10:15 Centos-debuginfo.repo
-rw-r--r--. 1 root root 626 July 3 10:15 Centos-media.repo
4. Disable Yum's network update mode, simply rename the default preferred Centos-base.repo to Centos-base.repo.bak
[Email protected] yum.repos.d]# MV Centos-base.repo Centos-base.repo.bak
5. Configure local Yum Source
[Email protected] ~]# Vim/etc/yum.repos.d/centos-media.repo
Will
[C6-media]
name=centos-$releasever-media
baseurl=file:///media/centos/
file:///media/cdrom/
file:///media/cdrecorder/
Gpgcheck=1
Enabled=0
Revision changed to
[C6-media]
name=centos-$releasever-media
baseurl=file:///media/centos/
Gpgcheck=1
Enabled=1
Where BaseURL changes to the mount directory of the DVD, enabled=1 turn on local update mode
: Wq Save Exit
6. Clear the original Yum information
[email protected] ~]# Yum Clean all
Loaded Plugins:fastestmirror
Cleaning up everything
7. Check the DVD software list
[email protected] yum.repos.d]# Yum list
Loaded Plugins:fastestmirror
Determining fastest Mirrors
C6-media | 3.7 KB 00:00 ...
c6-media/primary_db | 3.3 MB 00:00 ...
This will be the default use of DVD installation software, if you want to restore the network installation mode, the Centos-base.repo.bak renamed to restore.
PS. Each time you restart the system, you need to mount the DVD manually to/media/centos/, and if you are bothered, you can automatically mount it by writing your own script.
Linux configuration Local Source