zoukankan      html  css  js  c++  java
  • centos7修改软件源

    # 清除缓存
    yum clean all

    sudo rm -rf /var/cache/yum

    # 卸载epel仓库

    yum remove epel-release

    # 删除所有旧仓库文件
    # 注意,如有其它仓库文件请自行重装或选择性删除

    rm -rf /etc/yum.repos.d/*

    vi /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
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-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
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-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
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-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-CentOS-7

    # 建立缓存
    yum makecache
    # 重新安装EPEL仓库
    yum install epel-release

    参考博客:https://blog.csdn.net/w958660278/article/details/80615048

  • 相关阅读:
    MQTT研究之EMQ:【JAVA代码构建X509证书【续集】】
    MQTT研究之EMQ:【JAVA代码构建X509证书】
    MQTT研究之EMQ:【SSL证书链验证】
    自己DIY出来一个JSON结构化展示器
    Mac系统还原
    Mac初用
    工作中缓存使用方式的总结
    面试突击(八)——JVM的结构及内存模型,是怎么划分的?
    面试突击(七)——JVM如何加载Java字节码信息的?
    面试突击(六)——JVM如何实现JAVA代码一次编写到处运行的?
  • 原文地址:https://www.cnblogs.com/cyf18/p/13920977.html
Copyright © 2011-2022 走看看