1.虚拟机要加载centos安装光盘dvd,先把光驱挂载到任意目录下,如:mount /dev/cdrom /media
2.配置/etc/yum.repos.d/CentOS-Base.repo文件,vim打开,整个文件内容配置如下:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
baseurl=file:///media
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
3.yum list |grep httpd,查看有哪些可用包