CentOS7 配置阿里云yum源


首先把selinux给禁用掉,不禁用有时候会各种各样的错误

 

查看

[root@localhost ~]# getenforce
Enforcing

 

永久关闭

[root@localhost ~]# vi /etc/selinux/config

 

 

修改

SELINUX=disabled 

 

设置后需要重启才能生效

[root@localhost ~]# reboot

 

先执行

[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum -y install yum-utils
[root@localhost ~]# yum install wget

 

备份

[root@localhost~]# yum install wget
[root@localhost~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir repo_bak
[root@localhost yum.repos.d]# mv *.repo repo_bak/
[root@localhost yum.repos.d]# ls
repo_bak

 

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

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS
-Base.repo repo_bak

之后运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM