1, installation Vm-tools
2, set the shared folder, I set the shared folder is E:\ProgramData name: ProgramData
3. Create Folder mkdir/media/centos/
4. Mount the ISO file
In CentOS, after setting up the file share, we can find a programdata/subdirectory in the/mnt/hgfs/directory, the CentOS ISO file is also in this directory, I share later, the ISO file in the CentOS path is
/mnt/hgfs/programdata/centos-6.3-x86_64-bin-dvd2.iso
Mount the image file to/media/centos/
[Email protected] yum.repos.d]# Mount-o loop /mnt/hgfs/programdata/centos-6.3-x86_64-bin-dvd2.iso/media/ centos/
5. Modify the configuration file
cd/etc/yum.repos.d/
[Email protected] yum.repos.d]# more Centos-media.repo
# Centos-media.repo
#
# This repo was used to mount the default locations for a CDROM/DVD on
# 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 on your DVD and use it with the other repos too:
# yum--enablerepo=c6-media [command]
#
# or for the media repo, does this:
#
# yum--disablerepo=\*--enablerepo=c6-media [command]
[C6-media]
name=centos-$releasever-media
baseurl=file:///media/centos/
file:///media/cdrom/
file:///media/cdrecorder/
Gpgcheck=1
Enabled=0
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
Where BaseURL is the parameter we need to modify, because we have already mounted the ISO image in the/media/centos/directory, so we don't need to modify it. Yum local source can be used.
6. Install the software using local Yum source
The method of using the local Yum source has been described in Centos-media.repo:
(4.1) In addition to using the local Yum source, other Yum sources will be used
Yum--enablerepo=c6-media [command]
(4.2) Just use local Yum source
Yum--disablerepo=/*--enablerepo=c6-media [command]
Here is the installation of MySQL with local Yum source
[email protected] yum.repos.d]# Yum--disablerepo=/*--enablerepo=c6-media Install Mysql-server
CentOS Settings Use local source