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 Centosdvd , the software is sufficient to meet our needs, and The software version of the DVD is stable version, download speed is fast, for learning CentOS , the Centosdvd 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 Centosdvd 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 7 months 310:15 Centos-base.repo
-rw-r--r--. 1 root root 637 7 months 310:15 Centos-debuginfo.repo
-rw-r--r--. 1 root root 626 7 months 310:15 Centos-media.repo
4.Disable yum 's network update mode, simply rename the default preferred Centos-base.repo to Centos-base.repo.bak can
[[Email protected]]# 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
Loadedplugins:fastestmirror
Cleaningup everything
7. Check the DVD software list
[Email protected]]# yum List
Loadedplugins:fastestmirror
Determiningfastest 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.
How the local image is used as a Yum source