我正在尝试按照此安装 1:1.7.0.65-2.5.1.2.el6_5 版本的 OpenJDK堆栈交换答案,但我无法指定确切的版本号,例如
yum install java-1.7.0-openjdk-devel-1:1.7.0.65-2.5.1.2.el6_5
yum 说找不到包。这是由于包名称中的连字符造成的吗?
如何强制 yum 安装此特定版本的 Open JDK 1.7
yum --showduplicates list java-1.7.0-openjdk-devel
给出
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.3-2.1.el6.7 RedHat-updates-QPK-6Server-optional-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.5-2.2.1.el6_3 RedHat-updates-QPK-6Server-optional-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.5-2.2.1.el6_3.3 RedHat-updates-QPK-6Server-optional-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.3.el6_3.1 RedHat-updates-QPK-6Server-optional-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.3.el6_3.1 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.3.2.el6_3 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.4.1.el6_3 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.5.3.el6_3 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.7.1.el6_3 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.8.0.el6_4 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.19-2.3.9.1.el6_4 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.25-2.3.10.3.el6_4 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.25-2.3.10.4.el6_4 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.45-2.4.3.2.el6_4 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.45-2.4.3.3.el6 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.45-2.4.3.4.el6_5 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.51-2.4.4.1.el6_5 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.55-2.4.7.1.el6_5 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.65-2.5.1.2.el6_5 RedHat-updates-QPK-6Server-x86_64
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.71-2.5.3.1.el6 RedHat-updates-QPK-6Server-x86_64
答案1
这不是由于包名称中的连字符造成的 - 您想要做的正是它应该如何工作。 Yum 出现问题的原因可能是您指定的版本中存在冒号,或者是因为您指定的版本在您在系统上配置的任何存储库中都不可用。当您执行 时,您是否看到可用的 OpenJDK 的特定版本yum list
?
答案2
您需要以 root 用户身份运行以下命令:
# yum install java-1.7.0-openjdk-devel-1.7.0.65-2.5.1.2.el6_5