配置本地YUM:
挂载光盘:
mount /dev/cdrom /media/cdrom/
vim /etc/yum.repos.d/CentOS-Media.repo
===================================================================================
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. 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=c5-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
===================================================================================
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
如果不加上面那一句的话默认走的是网络源不是本地源,会出错!
测试:
yum clean all 清除缓存及旧的包
yum install -y httpd 测试是否能安装软件