centos Stream 8 因官方停止支持,所以對應的源也失效了。
首先備份/etc/yum.repos.d/下的所有文件,然后清空這個文件夾。
然后在這個目錄新建一個文件,如采用阿里的源,將以下代碼保存,命名為:Aliyun-Centos-Stream-8.repo。
[BaseOS] name=BaseOS baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/ enabled=1 gpgcheck=0 [Appstream] name=Appstream baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os/ enabled=1 gpgcheck=0 [Extras] name=Extras baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/x86_64/os/ enabled=1 gpgcheck=0 [PowerTools] name=PowerTools baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/x86_64/os/ enabled=1 gpgcheck=0
繼續執行 清理
yum clean all
更新
yum makecache