如何在 RHEL 7 中安装 perl?

如何在 RHEL 7 中安装 perl?

我使用RHEL 7.2并想要安装perl。执行yum install perl,它输出以下内容:

# yum install perl
......
Total size: 11 M
Total download size: 8.0 M
Installed size: 36 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for rhel-7-server-rpms
perl-File-Path-2.09-2.el7.noar FAILED                                            ]  0.0 B/s |    0 B  --:--:-- ETA
https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/Packages/perl-File-Path-2.09-2.el7.noarch.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=rhel-7-server-rpms clean metadata
Trying other mirror.
perl-5.16.3-286.el7.x86_64.rpm FAILED                                            ] 258 kB/s | 4.7 MB  00:00:13 ETA
https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os/Packages/perl-5.16.3-286.el7.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=rhel-7-server-rpms clean metadata
Trying other mirror.


Error downloading packages:
  perl-File-Path-2.09-2.el7.noarch: [Errno 256] No more mirrors to try.
  4:perl-5.16.3-286.el7.x86_64: [Errno 256] No more mirrors to try.

我试过了yum --enablerepo=rhel-7-server-rpms clean metadata,但结果是一样的。如何修复此问题才能perl成功安装RHEL 7

答案1

只需执行yum clean all

yum clean all

那么这个问题就解决了。

相关内容