Rhel

從 epel repo 下載 java-1.8.0-openjdk-devel

  • October 6, 2019

我們有 redhat 機器 - 版本 7.2

我們安裝了 epel repo 如下

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum install epel-release


yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                                                                   repo name                                                                                                    status
epel/x86_64                                                               Extra Packages for Enterprise Linux 7 - x86_64                                                               13,416
repolist: 13,416

但是當我們想將java安裝為

yum install java-1.8.0-openjdk-devel*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
No package java-1.8.0-openjdk-devel* available.
Error: Nothing to do

我錯在哪裡?

如錯誤消息所述,您的系統未註冊。來自java-1.8.0-openjdk-devel/etc/yum.repos.d/redhat-repo 文件中指定的 Redhat Repos 之一。yum repolist出於這個原因,這些儲存庫在執行時不會出現。yum如果沒有註冊系統,您將無法從這些儲存庫安裝任何軟體包。

EPEL 提供的 Javajava-latest-openjdk包括java-latest-openjdk-devel版本 1:12.0.2.9-1。如果它可以安裝,您可以安裝它,但如果您需要 1.8.0,那麼您需要向 Red Hat 註冊系統。

引用自:https://unix.stackexchange.com/questions/545074