自学内容网 自学内容网

CentOS AppStream 8 手动更新 yum源

由于CentOS 8的官方支持已在2021年12月31日结束,官方镜像中的CentOS 8包已被移除。因此,如果您仍然需要运行CentOS 8并更新其yum源,您可以考虑使用以下步骤来配置一个可用的yum源,例如阿里云的镜像源。

https://mirrors.aliyun.com/centos/8-stream/?spm=a2c6h.25603864.0.0.132666edLGinrb

1.备份现有的yum源配置文件:

cd /etc/yum.repos.d/
mkdir backup
mv *.repo backup/

2.编辑yum源配置文件:
a.手动创建CentOS-AppStream.repo

vim CentOS-AppStream.repo
i
[appstream]
name=CentOS-8-stream - 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

保存退出;
b.手动创建CentOS-BaseOS.repo

vim CentOS-BaseOS.repo
i
[baseos]
name=CentOS-8-stream - BaseOS
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

保存退出;
c.手动创建CentOS-Devel.repo

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

保存退出;
d.手动创建CentOS-Extras.repo

vim CentOS-Extras.repo
i
[baseos]
name=CentOS-8-stream - 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

保存退出;
4.清空并重建yum缓存:

yum clean all
yum makecache

5.更新软件包:

yum update


原文地址:https://blog.csdn.net/u012082566/article/details/143626999

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!