C/C++教程

centos yum 国内源

本文主要是介绍centos yum 国内源,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[root@kangvcar ~]# cat /etc/redhat-release        //查看系统的版本
CentOS Linux release 7.2.1511 (Core)
[root@kangvcar ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# 如果没有wget命令

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

# 注意curl -o (o是小写)

清除缓存

[root@kangvcar ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@kangvcar ~]# yum makecache        //把Yum源缓存到本地,加快软件的搜索好安装速度
[root@kangvcar ~]# yum list        

如果是其它centos版本

#各系统版本repo文件对应的下载操作
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.repo http://mirrors.aliyun.com/repo/Centos-7.repo
这篇关于centos yum 国内源的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!