CentOS 6.8配置yum源为阿里云软件源

一、备份

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

提示 “ mv: cannot stat `/etc/yum.repos.d/CentOS-Base.repo': No such file or directory ” 的话直接进行下一步。

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

点击到任何一个有二进制包的开源软件详情页,我们都可以看到配置文件的下载链接,比如对于 centos6系统,其配置文件下载地址为:

https://mirrors.aliyun.com/opensource/149994924900000037/opsx/centos6/opsx-centos6.repo

6U下载

wget https://mirrors.aliyun.com/opensource/149994924900000037/opsx/centos6/opsx-centos6.repo -O /etc/yum.repos.d/opsx-centos6.repo

7U 下载

wget https://mirrors.aliyun.com/opensource/149994924900000037/opsx/centos7/opsx-centos7.repo -O /etc/yum.repos.d/opsx-centos7.repo

查看仓库

yum repolist | grep opsx
opsx-centos7                opsx-centos7 

安装软件

yum install opsx-demo

三、运行yum makecache生成缓存

yum makecache

声明:本文章总结于 http://mirrors.aliyun.com/help/centos 与 https://opsx.alibaba.com/guide?lang=zh-CN&document=4662202e-bc8a-11e8-9aee-00163e000f43

你可能感兴趣的:(Linux)