今天看到服务器提示有漏洞需要更新,在执行更新命令的时候一直报错,因为CentOS 6 *** 作系统版本结束了生命周期(EOL),Linux社区已不再维护该 *** 作系统版本。导致不能正常更新,接下来吾爱编程为大家介绍一下Centos6 yum源失效解决方法,有需要的小伙伴可以参考一下:
1、背景信息:2020年12月2日起,centos官方停止了对centos6的所有更新并且下架了包括官方所有的centos6源,目前阿里、163、清华等centos6源已无法使用。
如果非要用centos6的话就只能使用vault源,国内的vault源的话:
https://mirrors.tuna.tsinghua.edu.cn/centos-vault/、http://mirrors.aliyun.com/centos-vault/
2、解决方法: 2.1备份文件mv /etc/yum.repos.d/CentOS-base.repo /etc/yum.repos.d/CentOS-base.repo.backup2.2更改CentOS-base.repo文件
vim /etc/yum.repos.d/CentOS-base.repo
更改内容如下
[base] name=CentOS-$releasever enabled=1 failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6 [updates] name=CentOS-$releasever enabled=1 failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6 [extras] name=CentOS-$releasever enabled=1 failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-6.10 - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-6.10 - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos-vault/centos/RPM-GPG-KEY-CentOS-62.2更改epel.repo文件
vim /etc/yum.repos.d/epel.repo
更改内容如下
[epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [epel-debuginfo] name=Extra Packages for Enterprise Linux 6 - $basearch - Debug baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=0 [epel-source] name=Extra Packages for Enterprise Linux 6 - $basearch - Source baseurl=http://mirrors.aliyun.com/epel-archive/6/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=02.4 yum更新
yum update sudo
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)