问题现象:更新了yum源中组件安装包,但是yum install报错;
前提条件:yum源是26机器,更新其中的一个rpm包,yum源主机和需要下载组件的客户端主机(28)都执行了yum更新操作
操作步骤:
1、在客户端主机(28)上执行:yum install ips -y
预期结果:
1、28上下载ips组件成功
实际结果:
1、28上下载ips组件成功失败,报错:[Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=ips clean metadata0:00 ETA
Trying other mirror.
具体报错信息如下:
[root@28 app]# yum reinstall ips -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ips.x86_64 0:1.0-10.el7.centos will be reinstalled
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================
Reinstalling:
ips x86_64 1.0-10.el7.centos ips 87 M
Transaction Summary
==============================================================================================================================================================================
Reinstall 1 Package
Downloading packages:
ips-1.0-10.el7.centos.x86_64.r FAILED ============================================== ] 50 MB/s | 66 MB 00:00:00 ETA
http://10.1.235.26/yum/ips/ips-1.0-10.el7.centos.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=ips clean metadata0:00 ETA
Trying other mirror.
Error downloading packages:
ips-1.0-10.el7.centos.x86_64: [Errno 256] No more mirrors to try.
尝试过的方法:
方法一:
[root@28 app]# yum --enablerepo=ips clean metadata
Loaded plugins: fastestmirror, langpacks
Cleaning repos: ips rhel
7 metadata files removed
12 sqlite files removed
0 metadata files removed
重试下载仍然失败
【定位】是yum源的组件更新后,未更新索引
方法二:成功
在yum源目录下,更新对应的rpm包,然后更新索引,最后所有主机上更新yum源(yum clean all;yum makecache);就解决问题了;
1、yum源目录是/data/yum/ips,更新对应的安装包
2、更新索引:sudo createrepo -pdo /data/yum/ips;
sudo createrepo --update /data/yum/ips;
3、所有主机上更新yum源(yum clean all;yum makecache)