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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12403031/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 14:20:37  来源:igfitidea点击:

Unable to yum install anything on RHEL

linuxyumrhel

提问by Prakash Raman

I am on a new RHEL system.

我在一个新的 RHEL 系统上。

I seem to be unable to be able to install anything package via yum install.

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

yum install nmap

The current repos in

当前的回购在

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

What could be going wrong ?

可能出什么问题了?

OUTPUT OF YUM INSTALL:

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

回答by Andy Thompson

Try "searching" for the correct package name in the reps by using yum list

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

yum list nmap

I guess the correct package name and install command is:

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

yum install nmap.x86_64

You can also do a "yum search somename"

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

回答by PentheusLennuye

Red Hat doesn't use the /etc/yum.repos.d directory for official packages so the answer won't be in there. It will use the subscription plugin placed in /etc/yum/pluginconf.d.

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

You mentioned that the RHEL host is new. You will need to make sure your subscription is valid or yum will fail silently.

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

You can use the subscription-manager listcommand to gain info regarding subscriptions.

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

回答by Vijay S B

If you have OS image in your lab or any location you can try this for some 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

Then do yum clean all

然后做 yum clean all

baseurl is the location where your OS image is available. No subscription is needed, it is reusing your OS image

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

回答by erTugRul

Centos has done it for you.

Centos已经为你做到了。

Create a repo file in /etc/yum.repos.d as

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

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

Then paste this in this file:

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

[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

Saving it with wq! now run

用 wq 保存它!现在运行

yum repolist

Check if you can install any package (say nmap)

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

yum install nmap -y

Enjoy!!!

享受!!!

回答by tplive

In my case, I was trying to install OpenJDK using yum; sudo yum install -y java-1.8.0-openjdk-develbut received an error message stating that a dependency was unavailable:

就我而言,我试图使用 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
**********************************************************************

I resolved this by following the suggestion please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.confand then ran the yum command again. This time yum loaded a bunch of [previously disabled] repos and searched through them, finally reporting success and this message:

我按照建议解决了这个问题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
*******************************************************************

So there was no ignored *-develrepo, but still doing this worked. For clearance, the explicitly ignored repos are: ignored_repos=*debug-rpms *source-rpms *beta-rpms

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

..so that worked, but I'm still no wiser on the mechanics of this..

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

回答by Rajesh Kondra

Try installing using:

尝试使用安装:

yum install nmap-frontend

It worked for me on Red Hat Enterprise Linux Server release 7.7 (Maipo)

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

You can use the following line to test:

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

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