首页 > 其他 > 详细

redhat centos yum源的安装

时间:2015-10-09 10:26:21      阅读:287      评论:0      收藏:0      [点我收藏+]
1.除旧
#cd /etc/yum.repos.d #mv rhel-debuginfo.repo rhel-debuginfo.repo.bak 此处将其备份起来,供意外恢复时使用,如有其他的相关的源设置,都要删除,或是采用以上方法备份。
删除RHEL5自带的YUM及YUM组件 使用rpm -qa | grep yum列出所有相关的包,把它们都删掉,如果因依赖性不能删除,就使用–nodeps参数删除。
2.换新 centos mirrorlist   http://www.centos.org/modules/tinycontent/index.php?id=32 找到下面的软件装上
而后
vim /etc/yum.repos.d/Centos-Base.repo
写入下面的内容:
[base]
name=CentOS-5 - Base
repo=os
gpgcheck=1
[update]
name=CentOS-5 - Updates
baseurl=http://centos.ustc.edu.cn/centos/5/updates/x86_64/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-5 - Addons
baseurl=http://centos.ustc.edu.cn/centos/5/addons/x86_64/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-5 - Extras
baseurl=http://centos.ustc.edu.cn/centos/5/extras/x86_64/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-5 - Plus
baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[contrib]
name=CentOS-5 - Contrib
baseurl=http://centos.ustc.edu.cn/centos/5/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
###################
3.Available Repositories for CentOS
根据需要选择适合的repo http://wiki.centos.org/AdditionalResources/Repositories
3rd Party Repositories
推荐源:Extra Packages for Enterprise Linux (EPEL) The Community Enterprise Linux Repository
根据自己需求选择合适的repo
cd /var/cache/yum rm -f * yum list yum search 到这yum应该就可以使用了
4.更新
如果不想升级内核而只更新其他软件包,有两种方法:
1、修改yum配置文件:vim /etc/yum.conf, 在[main]的最后添加exclude=kernel*
2、直接在yum的命令后面添参数:
yum --exclude=kernel* update
 

redhat centos yum源的安装

原文:http://www.cnblogs.com/wq242424/p/4863103.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!