繁体   English   中英

无法在 RHEL 上 yum 安装任何东西

[英]Unable to yum install anything on RHEL

我在一个新的 RHEL 系统上。

我似乎无法通过 yum install 安装任何软件包。

yum install nmap

当前的回购在

ls /etc/yum.repos.d/
google-chrome.repo  redhat.repo         rhel-source.repo

可能出什么问题了?

yum 安装的输出:

$ sudo yum install nmap
[sudo] password for user: 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package nmap available.
Error: Nothing to do

Red Hat 不将 /etc/yum.repos.d 目录用于官方软件包,因此答案不会在那里。 它将使用放置在 /etc/yum/pluginconf.d 中的订阅插件。

您提到 RHEL 主机是新的。 您需要确保您的订阅有效,否则 yum 将无声无息地失败。

您可以使用subscription-manager list命令获取有关订阅的信息。

Centos已经为你做到了。

在 /etc/yum.repos.d 中创建一个 repo 文件作为

vi /etc/yum.repos.d/myrepo.repo

然后将其粘贴到此文件中:

[centos]
name=CentOS-7
baseurl=http://ftp.heanet.ie/pub/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://ftp.heanet.ie/pub/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

用 wq 保存它! 现在运行

yum repolist

检查您是否可以安装任何软件包(例如 nmap)

yum install nmap -y

享受!!!

尝试使用 yum list 在代表中“搜索”正确的包名称

yum list nmap

我猜正确的包名和安装命令是:

yum install nmap.x86_64

你也可以做一个“yum search somename”

就我而言,我试图使用 yum 安装 OpenJDK; sudo yum install -y java-1.8.0-openjdk-devel但收到一条错误消息,指出依赖项不可用:

---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.201.b09-1.el6_10 will be installed
--> Processing Dependency: pcsc-lite-devel(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64 (rhel-6-server-rpms)
           Requires: pcsc-lite-devel(x86-64)
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************

我按照建议解决了这个问题, please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf ,然后再次运行 yum 命令。 这次yum加载了一堆[以前禁用]的repos并搜索了它们,最终报告成功并显示以下消息:

*******************************************************************
Dependency resolving was successful thanks to enabling these repositories:
rhel-6-server-optional-rpms
*******************************************************************

所以没有被忽略的*-devel库,但这样做仍然有效。 为了清除,明确忽略的存储库是: ignored_repos=*debug-rpms *source-rpms *beta-rpms

..所以这行得通,但我对这个机制仍然不了解..

如果您的实验室或任何位置有操作系统映像,您可以为某些 RPMS 尝试此操作

vim /etc/yum.repos.d/rhel.repo
[rhel]
name=rhel
baseurl=http://172.25.5.25/osimages/rhel7.2_64bit
enabled=1
gpgcheck=0

然后做yum clean all

baseurl 是您的操作系统映像可用的位置。 无需订阅,它正在重用您的操作系统映像

尝试使用安装:

yum install nmap-frontend

它在 Red Hat Enterprise Linux Server 7.7 (Maipo) 版上对我有用

您可以使用以下行进行测试:

nmap 25 gmail-smtp-in.l.google.com

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM