无法在RHEL上安装任何东西

时间:2012-09-13 09:13:59

标签: linux yum rhel

我正在使用新的RHEL系统。

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

yum install nmap

目前的回购

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

可能出现什么问题?

安装输出的次数:

$ 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

6 个答案:

答案 0 :(得分:9)

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

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

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

答案 1 :(得分:1)

使用yum list

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

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

yum install nmap.x86_64

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

答案 2 :(得分:0)

如果您的实验室或任何位置有操作系统映像,您可以尝试使用某些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是您的操作系统映像可用的位置。不需要订阅,它正在重用您的操作系统映像

答案 3 :(得分:0)

Centos已经为你完成了。

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

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="@dimen/dp_15">

    <LinearLayout
        android:id="@+id/ll_button_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="@dimen/dp_20"
        android:orientation="horizontal">

        <RelativeLayout
            android:id="@+id/rl_yes"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@drawable/cornered_green_bg"
            android:padding="@dimen/dp_15"
             >
        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/tv_yes"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fontPath="ProximaNova-Semibold.otf"
            android:text="@string/yes"
            android:layout_centerHorizontal="true"
            android:textColor="@color/White"
            android:textSize="@dimen/sp_18"
            />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toStartOf="@id/tv_yes"
                android:src="@drawable/ic_driver_request_coming_accept"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/dp_10"
                />
        </RelativeLayout>
        <RelativeLayout
            android:id="@+id/rl_no"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:layout_marginStart="@dimen/dp_10"
            android:background="@drawable/cornered_red_bg"
            android:padding="@dimen/dp_15"
            >
            <android.support.v7.widget.AppCompatTextView
                android:id="@+id/tv_no"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:fontPath="ProximaNova-Semibold.otf"
                android:text="@string/yes"
                android:layout_centerHorizontal="true"
                android:textColor="@color/White"
                android:textSize="@dimen/sp_18"
                />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toStartOf="@id/tv_no"
                android:src="@drawable/ic_driver_request_coming_reject"
                android:layout_centerVertical="true"
                android:layout_marginEnd="@dimen/dp_10"
                />
        </RelativeLayout>
    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_data"
        android:layout_above="@id/ll_button_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</RelativeLayout>

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

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

用wq保存!现在运行

[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

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

yum repolist

享受!!!

答案 4 :(得分:0)

就我而言,我试图使用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加载了一堆[先前被禁用的]仓库并搜索它们,最后报告成功和以下消息:

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

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

..所以行得通,但是我仍然不懂这种机制。

答案 5 :(得分:0)

尝试使用以下方法进行安装:

yum install nmap-frontend

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

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

nmap 25 gmail-smtp-in.l.google.com
相关问题