zoukankan      html  css  js  c++  java
  • Centos8更换官方默认更新源CentOS-Base.repo

    ⒈备份官方默认更新源文件

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

    ⒉编辑

      1.打开默认更新源CentOS-Base.repo

    vi /etc/yum.repos.d/CentOS-Base.repo

      2.清空内容

      按下ESC后进入命令模式后输入

    :.,$d

      3.复制为以下内容(清华大学镜像站)https://mirrors.tuna.tsinghua.edu.cn/help/centos/

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

      4.保存

      按下ESC后进入命令模式后输入

    :wq

    ⒊更新软件源缓存

    yum makecache
  • 相关阅读:
    准备工作
    使用awstats分析nginx日志
    kvm虚拟化环境中的时区设置
    使用awk格式化输出文本
    gitlab(7.9)升级到8.0.1
    为openstack制作CoreOS虚拟机镜像(基于CoreOS官方提供镜像)
    KVM虚拟化之嵌套虚拟化nested
    编译制作Linux 3.18内核rpm包(升级centos6.x虚拟机内核)
    Linux主机之间传输文件的几种方法对比
    spice在桌面虚拟化中的应用系列之二(Linux平台spice客户端的编译安装,支持USB映射)
  • 原文地址:https://www.cnblogs.com/fanqisoft/p/12769162.html
Copyright © 2011-2022 走看看