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
[devel]
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
[extras]
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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值