• CentOS 7 配置清华大学EPEL镜像


    一.备份 CentOS-Base.repo

    sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

    二.配置CentOS-Base.repo

    使用下面配置覆盖/etc/yum.repos.d/CentOS-Base.repo文件

    # CentOS-Base.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.
    #
    #
    
    
    [base]
    name=CentOS-$releasever - Base
    baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
    
    
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
    
    
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7

    如果不想检查gpg公钥,则gpgcheck都设0.

    更新下

    yum clean all

    三.安装EPEL镜像

    yum -y install epel-release

    四.配置EPEL

    使用下面命令替换epel使用清华大学源

    sed -e 's!^metalink=!#metalink=!g' 
        -e 's!^#baseurl=!baseurl=!g' 
        -e 's!//download.fedoraproject.org/pub!//mirrors.tuna.tsinghua.edu.cn!g' 
        -e 's!http://mirrors.tuna!https://mirrors.tuna!g' 
        -i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo

    五.更简便的使用EPEL镜像的方法

    rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm

    本文整理自清华大学镜像站

  • 相关阅读:
    HDU 3565 Bi-peak Number(数位DP)题解
    FJNU Fang G and his Friends(状压DP)题解
    newcoder 小A的柱状图(单调栈)题解
    CodeForces 518E Arthur and Questions(贪心 + 思维)题解
    装饰器来激活生成器
    迭代器(Iterator)和生成器(generator)浅析
    简单的获取网页样式元素(装饰器实现)
    多层装饰器的调用及执行顺序
    三角形的输出
    简单的用户登录(文件处理)
  • 原文地址:https://www.cnblogs.com/GaZeon/p/12758150.html
Copyright © 2020-2023  润新知