Since the installation of CentOS without a graphical interface is minimized on VMware virtual machines, installing the VMware Tools times error prompts you to install Perl with the option to configure a local Yum source for installation with the CentOS installation CD in the absence of a network connection.
1. Load the installation CD ISO file into the CD drive and mount the optical drive to the system files directory:
Mkdir-p/mnt/cdrom #创建挂载目录mount/dev/cdrom/mnt/cdrom #挂载光盘
2. Modify the Yum source configuration file:
ls -l /etc/yum.repos.d/ #进入yum源配置文件目录mv centos-base.repo centos-base.repose_bak #重命名或删除CentOS-base.repo File mv centos-debuginfo.repo centos-debuginfo.repo_bak #重命名或删除CentOS-debuginfo.repo File vi centos-media.repo # Edit the file Centos-media.repo, which is roughly the following
# 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 #名称描述baseurl =file:///mnt/ cdrom/ #yum源目录, source address gpgcheck=1   ; #检查GPG-key,0 for no check, 1 for check enabled=1 #是否用该yum源, 0 for Disable, 1 for use gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-c EntOS-6 #gpgcheck = 0 o'clock no configuration required
3. Test if Yum is configured successfully
Yum List
4. Clear Yum Cache
Yum Clean All
Of course, the above method can also copy the contents of the disc to the local file system, and then specify the directory as the source address.
CentOS Configuration local Yum source