博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
国内yum源的安装(163,阿里云,epel)
阅读量:4561 次
发布时间:2019-06-08

本文共 2316 字,大约阅读时间需要 7 分钟。

----阿里云镜像源

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

或者

curl -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

或者

curl -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.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行 yum clean all; yum makecache 生成缓存

 

----163镜像源

第一步:备份你的原镜像文件,以免出错后可以恢复。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup   第二步:下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3、之后运行 yum clean all,yum makecache 生成缓存

----EPEL

(Extra Packages for Enterprise Linux)是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。装上了 ,就像在 Fedora 上一样,可以通过 yum install 软件包名,即可安装很多以前需要编译安装的软件、常用的软件或一些比较流行的软件,比如现在流行的nginx、htop、ncdu、vnstat等等,都可以使用EPEL很方便的安装更新。

 

目前可以直接通过执行命令: yum install epel-release 直接进行安装,如果此命令无法安装可以尝试以下方法

----安装EPEL 阿里云源

1、备份(如有配置其他epel源)

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

2、下载新repo 到/etc/yum.repos.d/

epel(RHEL 7)

 

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

 

epel(RHEL 6)

 

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

 

epel(RHEL 5)

 

wget -O /etc/yum.repos.d/epel.repo 

 

----官方源直接安装

CentOS/RHEL 5 :

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

CentOS/RHEL 6 :

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

CentOS/RHEL 7 :

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

转载于:https://www.cnblogs.com/linkenpark/p/7775332.html

你可能感兴趣的文章
android学习记录(十三)Task 和 Activity 回退栈操作。
查看>>
EasyUI禁用控制方法常采用
查看>>
C++ 在dynamic_cast<>用法
查看>>
Solr使用入门指南
查看>>
Android 手机设置CMWAP 接入点
查看>>
3Sum Closest
查看>>
从此不再惧怕URI编码:JavaScript及C# URI编码详解(转)
查看>>
使用X-UA-Compatible来设置IE8兼容模式
查看>>
Python3.5-20190502-廖老师-自我笔记
查看>>
人力资源匹配数据表设计
查看>>
iOS-证书真机调试
查看>>
APP的六种loading加载样式,全在这...
查看>>
java基础
查看>>
玩转cocos2d-x lua-binding, 实现c++与lua混合编程
查看>>
Implement the Singleton In AS3
查看>>
一、Redis 服务相关命令
查看>>
.Net语言 APP开发平台——Smobiler学习日志:如何在手机上实现折线图表
查看>>
php缓存数组到文件
查看>>
HDU - 4289 Control (Dinic)
查看>>
[HDOJ 5183] Negative and Positive (NP) 【Hash】
查看>>