linux修改系统的yum源为阿里云并添加epel源

在安装软件的时候,经常出现下载速度慢,下载不成功,以及企业版软件安装不上的情况,可以通过修改linux修改系统的yum源为阿里云并添加epel源的方法解决。

#yum repolist   ###查询系统现在使用的软件列表 yum源 

#修改系统默认的yum 
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup  #备份
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo  #修改

#增加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  #备份
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo  #添加epel源

#安装htop测试epel源是否安装成功
yum install htop sl  -y
到阿里云的镜像官网去找镜像源也可以http://mirrors.aliyun.com

这里写图片描述

猜你喜欢

转载自blog.csdn.net/jiedao_liyk/article/details/78470458