2021年还可以用的Linux centos 6版本的yum源

最近给 CentOS 6 服务器安装软件时出现了错误:

[root@localhost ~]# yum install tree
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404”
Trying other mirror.

[base]
name=CentOS-$releasever – Base
failovermethod=priority
baseurl=https://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# released updates
[updates]
name=CentOS-$releasever – Updates
failovermethod=priority
baseurl=https://vault.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

# additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=https://vault.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

然后保存退出,应该就可以正常安装软件了,不行就重启服务器再试试看。
这里使用的是Centos的官方源,这个源除了速度有点慢,一直都是可以用的。适用于CentOS 6 的所有版本。

[epel]
name=Extra Packages for Enterprise Linux 6 – $basearch
baseurl=http://archives.fedoraproject.org/pub/archive/epel/6/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

然后保存退出,应该就可以正常安装软件了。
如果还不行就执行下面这三条命令,重启服务器再试试。
yum clean all
yum makecache
yum update

文章知识点与官方知识档案匹配,可进一步学习相关知识CS入门技能树Linux入门初识Linux24992 人正在系统学习中

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年6月11日
下一篇 2021年6月11日

相关推荐