您的位置 首页 centos

如何用阿里源替换原Centos的yum源

下面由Centos使用教程栏目给大家介绍用阿里源替换原Centos的yum源的方法,希望对需要的朋友有所帮助!

简单的了解几个开源站

如果需要下载一些镜像文件,例如CentOS或者Ubuntu等等之类的开源软件,可以再国内通过下面几个镜像站点来获取。

阿里的开源镜像站(https://opsx.alibaba.com/)

网易开源镜像站(http://mirrors.163.com/)

清华大学开源镜像站(https://mirrors.tuna.tsinghua.edu.cn/)

进入正题

1.备份

[root@localhost ~]# 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[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repoCentOS 6[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoCentOS 7[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.运行yum makecache生成缓存

  [root@localhost ~]# yum clean all    [root@localhost ~]# yum makecache    [root@localhost ~]# yum update

这里解释下yum makecache:就是把服务器的包信息下载到本地电脑缓存起来。

文章来源:智云一二三科技

文章标题:如何用阿里源替换原Centos的yum源

文章地址:https://www.zhihuclub.com/10906.shtml

关于作者: 智云科技

热门文章

网站地图