技术文档请注意发布时间,尽量查看1年以内的。
Centos版本:
[root@iZh3lv653tbr0nZ ~]# cat /etc/redhat-release
CentOS release 6.10 (Final)
问题 及 原因:
从2020年12月开始,CentOS6 结束了生命周期(EOL),相关的软件源移出了官方源,这样在使用 yum 命令安装软件时会出现如下错误:
[root@iZh3lv653tbr0nZ ~]# yum -y install lrzsz
Setting up Install Process
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/centos-sclo-rh/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) for repository: centos-sclo-rh. Please verify its path and try again
目前网上教程使用的第三方镜像站中大多是已移除CentOS 6的源 。
已确认可以使用的阿里源: https://mirrors.aliyun.com/centos-vault/6.10/
解决方法:
0x01--修改 resolv.conf
[root@h3v653t0nZ ~]# vi /etc/resolv.conf
options timeout:2 attempts:3 rotate single-request-reopen
; generated by /sbin/dhclient-script
nameserver 8.8.8.8
nameserver 8.8.4.4
0x02--关闭加速 fastestmirror
[root@h3v653t0nZ ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf
# 修改内容
enabled = 0 //由1改为0,禁用该插件
# 或者禁用所有插件【不是很推荐】
[root@h3v653t0nZ ~]# vi /etc/yum.conf
# 修改内容
plugins=0 //改为0,不使用插件
0x03--备份yum源
[root@h3v653t0nZ ~]# mv /etc/yum.repos.d/* /tmp/
0x04--下载新的yum源
[root@h3v653t0nZ ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
102 1749 102 1749 0 0 1530 0 0:00:01 0:00:01 --:--:-- 8172
[root@h3v653t0nZ ~]# ls /etc/yum.repos.d/
CentOS-Base.repo
0x05--验证 yum clean all & yum makecache
[root@h3v653t0nZ ~]# yum clean all
Cleaning repos: base extras updates
Cleaning up Everything
[root@h3v653t0nZ ~]# yum makecache
base | 3.7 kB 00:00
base/group_gz | 242 kB 00:00
base/filelists_db | 6.4 MB 00:21
base/primary_db | 4.7 MB 00:15
base/other_db | 2.8 MB 00:08
extras | 3.4 kB 00:00
extras/filelists_db | 24 kB 00:00
extras/prestodelta | 2.2 kB 00:00
extras/primary_db | 29 kB 00:00
extras/other_db | 14 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 8.4 MB 00:26
updates/prestodelta | 357 kB 00:01
updates/primary_db | 12 MB 00:38
updates/other_db | 479 kB 00:01
Metadata Cache Created
[root@h3v653t0nZ ~]# yum -y install lrzsz
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
lrzsz x86_64 0.12.20-27.1.el6 base 71 k
Transaction Summary
====================================================================================================================================
Install 1 Package(s)
Total download size: 71 k
Installed size: 159 k
Downloading Packages:
lrzsz-0.12.20-27.1.el6.x86_64.rpm | 71 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-27.1.el6
Complete!
[root@h3v653t0nZ ~]#
引用:
[原]使用fastestmirror插件给yum加速 - linuxの飘扬 - Power by www.linuxfly.org
http://www.linuxfly.org/post/297/CentOS 7 禁用fastestmirror插件并配置清华镜像源 - 简书
https://www.jianshu.com/p/281ee3db7c15centos7 yum fastestmirror不能使用_flx_bj的博客-CSDN博客_fastestmirror
https://blog.csdn.net/abcdad/article/details/78589461Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path_ 的博客-CSDN博客
https://blog.csdn.net/weixin_42272246/article/details/111316339