欢迎来到虎佩网_虎佩_hupei_hupeinet_hupei.net!
当前位置:首页 > Linux服务器 > linux问题解决 > 配置本地YUM 内容

配置本地YUM

选择字号: 超大 标准 发布时间:2015-03-07 18:24 | 作者:hupei

挂载光盘:
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 测试是否能安装软件
网站分类
最新文章
随机文章