码迷,mamicode.com
首页 > 其他好文 > 详细

yum源的问题

时间:2016-01-09 18:50:21      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:优先级

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/


CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo


扩展的epel源的安装

0.安装yum优先级插件

yum install yum-priorities

1.epel简介: https://fedoraproject.org/wiki/EPEL/zh-cn

rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm


以上URL请按实际情况修改

2.查看是否安装成功

rpm -q epel-release

 3.导入key:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6/7

4.修改/etc/yum.repos.d/epel.repo文件

在[epel]最后添加一条属性 priority=11

vi /etc/yum.repos.d/epel.repo

意思是yum先去官方源查,官方没有再去epel的源找

5.重建缓存

yum clean all

yum makecache



yum源的问题

标签:优先级

原文地址:http://5404542.blog.51cto.com/5394542/1733199

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!