CentOS 8 最新阿里YUM源

前文:由于CentOS8 已停止服务,相关源已经停止,前期官方自带的源和前期 阿里、清华、网易 等等的源,都已无法再使用,需要更换源。

安装程序时报错:

Failed to synchronize cache for repo 'AppStream', ignoring this repo.
Failed to synchronize cache for repo 'BaseOS', ignoring this repo.
Last metadata expiration check: 0:10:58 ago on Fri 10 Mar 2023 04:40:50 PM HKT.
No match for argument: wget
Error: Unable to find a match

解决方法:

1、下载阿里yum源:

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

2、修改AppStream文件,改为阿里源

sed -i 's/^/#/g' /etc/yum.repos.d/CentOS-AppStream.repo && echo "
[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 " >> /etc/yum.repos.d/CentOS-AppStream.repo

3、清除yum包管理器的缓存 并 更新yum的缓存

yum clean all
yum makecache

4、测试安装程序

yum install wget -y

成功...

猜你喜欢

转载自blog.csdn.net/beichen778/article/details/129446603