zoukankan      html  css  js  c++  java
  • [CentOS8]yum阿里源

    一键脚本

    cat > 01.yumrepo.sh << 'EOF'
    # 创建备份路径
    mkdir -p /etc/yum.repos.d/repo.bak/
    # 备份源
    mv /etc/yum.repos.d/CentOS-AppStream.repo /etc/yum.repos.d/repo.bak/
    # 导入镜像内容到yum文件中
    cat > /etc/yum.repos.d/CentOS-AppStream.repo <<'EOO'
    # CentOS-AppStream.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #
    
    [AppStream]
    name=CentOS-$releasever - AppStream
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
    #baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
    baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
    EOO
    #清除yum缓存
    yum clean all
    #重新做yum 缓存
    yum makecache
    # 安装 epel
    dnf -y install epel-release
    EOF
    # 执行该脚本
    bash 01.yumrepo.sh
    

    END

  • 相关阅读:
    《构建之法》第四章的感悟
    单复利软件单元测试
    实验一 操作系统模仿cmd
    <构建之法>第一二三章感悟
    近期工作量统计
    复利计算3.0
    复利运算
    单利运算1
    复利计算6.0
    汉堡包
  • 原文地址:https://www.cnblogs.com/leoshi/p/12502258.html
Copyright © 2011-2022 走看看