用阿里源替换原Centos的yum源

简单的了解几个开源站

若是须要下载一些镜像文件,例如CentOS或者Ubuntu等等之类的开源软件,能够再国内经过下面几个镜像站点来获取。缓存

进入正题

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.repo
  • CentOS 6
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  • CentOS 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:就是把服务器的包信息下载到本地电脑缓存起来。bash

相关文章
相关标签/搜索