一、编辑YUM源仓库文件
[root@main-server yum.repos.d]# cd /etc/yum.repos.d/
[root@main-server yum.repos.d]# vim redhat84-163.repo
redhat84-163.repo配置如下:
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated. Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#
[root@main-server yum.repos.d]# cat redhat84-163.repo
# Redhat.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=Redhat84 - 163 - Base
baseurl=https://mirrors.163.com/centos/8-stream/BaseOS/x86_64/os/
#baseurl=https://mirrors.163.com/centos/8.2.2004/BaseOS/x86_64/os/
#mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=BaseOS&infra=$infra
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=Redhat84 - 163 - AppStream
baseurl=https://mirrors.163.com/centos/8-stream/AppStream/x86_64/os/
#mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=AppStream&infra=$infra
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[PowerTools]
name=Redhat84 - 163 - PowerTools
baseurl=https://mirrors.163.com/centos/8-stream/PowerTools/x86_64/os/
#mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=PowerTools&infra=$infra
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that may be useful
[extras]
name=Redhat84 - 163 - Extras
baseurl=https://mirrors.163.com/centos/8-stream/extras/x86_64/os/
#mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=extras
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#additional packages that extend functionality of existing packages
[centosplus]
name=Redhat84 - 163 - Plus
baseurl=https://mirrors.163.com/centos/8-stream/centosplus/x86_64/os/
#mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=centosplus
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
二、清理之前的yum缓存。
[root@main-server yum.repos.d ]# yum clean all
三、建立新的缓存。
[root@main-server yum.repos.d ]# yum makecache
更多推荐