yum源使用阿里镜像

前提:需要联网才能使用

  1. 备份系统自带的yum源

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

    Centos如何安装阿里云yum源
  2.  

    下载和自己操作系统版本对应的yum源

    (wget命令需要安装否则无法下载!)

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

    Centos如何安装阿里云yum源
  3.  

    或者用另外一种方法下载

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

    建议采用后面一种方法下载,感觉效率要高些

    Centos如何安装阿里云yum源
  4.  

    运行yum makecache生成缓存

    Centos如何安装阿里云yum源
  5.  

    vim /etc/yum.repos.d/CentOS-Base.repo

    查看里面的内容,确实已经由系统自带的yum源替换为了阿里的yum源了

    Centos如何安装阿里云yum源
  6. 6

    使用yum源安装测试速度

    yum -y groupinstall "GNOME Desktop"

    如图所示,下载rpm包的速度得到了明显的提升

猜你喜欢

转载自www.cnblogs.com/Mercury-linux/p/11435944.html