美文网首页
新机配置阿里云yum源

新机配置阿里云yum源

作者: 肉包君 | 来源:发表于2020-09-03 11:58 被阅读0次

    2020-09-03

    新机配置阿里云yum源

    前提:
    Centos7.6
    可ping通外网,用于下载资源

    脚本:
    vim yum-source.sh

    #!/bin/bash
    
    #下载epel源和wget工具
    yum -y install wget epel-release
    #把默认下载源备份隔离
    cd /etc/yum.repos.d/ && mkdir bak && mv -f *.repo bak/
    #下载阿里云的源
    wget -O /etc/yum.repos.d/Centos-base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    #下载阿里云的epel源
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
     #清除旧的yum缓存,开启新缓存
    yum clean all && yum makecache
    #通过新的yum源下载一些常用工具
    yum -y install unzip lrzsz net-tools curl vim
    

    chmod a+x yum-source.sh #赋予可执行权限
    bash yum-source.sh #执行脚本即可一键换源

    相关文章

      网友评论

          本文标题:新机配置阿里云yum源

          本文链接:https://www.haomeiwen.com/subject/tcvnsktx.html