1.错误原因
CentOS 8于2021年12月31日停止维护

2.解决方法
依次清空/etc/yum.repos.d下CentOS-AppStream.repo、CentOS-Base.repo、CentOS-Extras.repo、CentOS-PowerTools.repo文件

cat /dev/null > /etc/yum.repos.d/CentOS-AppStream.repo
cat /dev/null > /etc/yum.repos.d/CentOS-Base.repo
cat /dev/null > /etc/yum.repos.d/CentOS-Extras.repo
cat /dev/null > /etc/yum.repos.d/CentOS-PowerTools.repo

依次修改/etc/yum.repos.d下CentOS-AppStream.repo、CentOS-Base.repo、CentOS-Extras.repo、CentOS-PowerTools.repo文件
修改CentOS-AppStream.repo

cat > /etc/yum.repos.d/CentOS-AppStream.repo <<EOF
# CentOS-AppStream.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.
#
#

[AppStream]
name=CentOS-$releasever - AppStream
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

修改CentOS-Base.repo

cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF
# 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.aliyun.com/centos/8-stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

修改CentOS-Extras.repo

cat > /etc/yum.repos.d/CentOS-Extras.repo <<EOF
# CentOS-Extras.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.
#
#

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

修改CentOS-PowerTools.repo

cat > /etc/yum.repos.d/CentOS-PowerTools.repo <<EOF
# CentOS-PowerTools.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.
#
#

[PowerTools]
name=CentOS-$releasever - PowerTools
baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

3.假设重新安装curl,返回installed即可

yum install curl -y

have fun!

标签: repo, Stream, yum

添加新评论