新建一个yum.repos.d文件
vi /etc/yum.repos.d/redhat.repo
cd /etc/yum.repos.d
vi /redhat.repo
在redhat文件里面加入下面镜像
#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
#
[ali_baseos]
name=ali baseos
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/
gpgcheck=0
[ali_appstream]
name=ali_appstream
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os/
gpgcheck=0