RHEL-Like
1 前言
CentOS 6.x由于已经超过官方的支持期限,所以当前大部分的yum源服务器都已经关闭,但vault的源仍然存在,所以我们可以重新定义源服务器指向该服务器来使用(可能会有点慢)。
2 最佳实践
2.1 清理旧的yum源定义
mkdir /etc/yum.repos.d/backup mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
2.2 重新定义yum源
vim /etc/yum.repos.d/CentOS-Base.repo
加入如下配置,
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-6.10 - Base baseurl=https://vault.centos.org/6.10/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-6.10 - Updates baseurl=https://vault.centos.org/6.10/updates/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-6.10 - Extras baseurl=https://vault.centos.org/6.10/extras/$basearch/ gpgcheck=1 gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-6.10 - Plus baseurl=https://vault.centos.org/6.10/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-6.10 - Contrib baseurl=https://vault.centos.org/6.10/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
2.3 清理旧的缓存
yum clean all
2.4 尝试列出安装包
yum list
没有评论