sxhack

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

CentOS 8 Stream 替换163镜像源

操作步骤

  • cd /etc/yum.repos.d 跳转目录

  • mv ./CentOS-Stream-BaseOS.repo ./CentOS-Stream-BaseOS.repo.backup 备份文件,

  • vi CentOS-Stream-BaseOS.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 - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/8-stream/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/8-stream/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/8-stream/extras/x86_64/os/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/8-stream/centosplus/x86_64/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

  • yum clean all && yum makecache 更新yum
posted on 2022-03-02 23:56  AlineL  阅读(2537)  评论(0)    收藏  举报