zoukankan      html  css  js  c++  java
  • 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

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

  • 相关阅读:
    八数码问题
    Choose and divide
    紫书 动态规划例题
    3657 括号序列 动态规划
    动态规划 舞蹈家怀特
    分数规划
    Keywords Search AC自动机
    Minimum Transport Cost Floyd 输出最短路
    A Simple Problem with Integers 线段树 区间更新 区间查询
    CF519E A and B and Lecture Rooms
  • 原文地址:https://www.cnblogs.com/GaZeon/p/12758150.html
Copyright © 2011-2022 走看看