我正在构建一个 Yum 存储库来安装 RPM 软件包。
我正在创建一个文件夹mkdir -p ~/yum/el7/x86_64
并将 rpm 文件移动到上面给出的相同路径下。
这是我的 my-app.repo 文件信息。
[my-app]
name=My App
baseurl=https://dl.my-app.com/yum/el7/$basearch
gpgkey=https://dl.my-app.com/rpm.gpg
gpgcheck=1
enabled=1
repo_gpgcheck=1
这是我安装软件包时遇到的错误。
[root@ip-192-31-59-132 ~]# yum install my-app
Loaded plugins: langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package my-app.x86_64 0:1.3.15-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================
Installing:
my-app x86_64 1.3.15-2.el7 my-app 9.5 M
Transaction Summary
==================================================================================================================================================================================
Install 1 Package
Total download size: 9.5 M
Installed size: 33 M
Is this ok [y/d/N]: y
Downloading packages:
my-app-1.3.15-2.el7.x8 FAILED
https://dl.my-app.com/yum/el7/x86_64/my-app-1.3.15-2.el7.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=my-app clean metadata
Trying other mirror.
Error downloading packages:
my-app-1.3.15-2.el7.x86_64: [Errno 256] No more mirrors to try.
[root@ip-192-31-59-132 ~]#
我的 Gnupg 配置正确。我希望这不是这个问题的原因。
我在这里做错了什么?为什么 Yum 会抛出Package does not match intended download
错误?
答案1
# yum clean metadata
然后再试一次。您的客户端 yum(8) 对 RPM 特征有自己的想法,因此要求它再次检查其存储库值。
答案2
下载后的包的散列密钥可能与存储库不匹配。清除元数据后重试执行更新。
# yum clean all ; yum update