CentOS / Linux · 8月 27, 2021 0

CentOS系统还原/更新官方yum源

在CentOS官方源的网站上有这么一段话:

Note that this service previously operated at packages.endpoint.com and moved to packages.endpointdev.com on 2021-11-30

总之就是从某天起以前的源不能用了,甭管啥你有没有整活翻车。所以需要用以下方法使用新地址。

RHEL/CentOS 8

yum clean all
dnf install https://packages.endpointdev.com/rhel/8/main/x86_64/endpoint-repo.noarch.rpm
cd /tmp
wget https://packages.endpointdev.com/endpoint-rpmsign-8.pub
rpm --import endpoint-rpmsign-8.pub
rpm -qi gpg-pubkey-4d996065 | gpg --show-keys --with-fingerprint

RHEL/CentOS 7

cd /tmp
wget https://packages.endpointdev.com/endpoint-rpmsign-7.pub
rpm --import endpoint-rpmsign-7.pub
rpm -qi gpg-pubkey-703df089 | gpg --with-fingerprint
yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
※下面讲的方法已经不能用了

整活过程中难免会翻车。比如把yum的源搞废了什么的。如需还原官方源,可参考以下步骤(这里仅以CentOS7为例,其他版本大同小异)👇

cd /etc/yum.repos.d/
rm -rf CentOS-*
rpm -Uvh --force http://mirror.centos.org/centos-7/7.9.2009/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm
yum clean all
yum makecache
yum update -y