6

I'm trying to install 1:1.7.0.65-2.5.1.2.el6_5 version of OpenJDK by following this stackexchange answer, but I'm not able to specify the exact version number like

yum install java-1.7.0-openjdk-devel-1:1.7.0.65-2.5.1.2.el6_5

yum says package not found. Is this due to hyphens in the package name?

How can I force yum to install this specific version of Open JDK 1.7

yum --showduplicates list java-1.7.0-openjdk-devel

gives

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

This is not due to hyphens in the package name - what you're trying to do is exactly how it's supposed to work. Yum is having problems either because of the colon in the version you're specifying, or because the version you're specifying isn't available in any of the repositories you have configured on the system. Do you see that specific version of OpenJDK available when you do a yum list?

  • yes it displays this version. I have updated the question with more details – coderplus Mar 9 '15 at 14:16
  • Try escaping the colon in the package string. That's what is most likely giving the shell problems (if my guess is right, the shell isn't passing the full string to yum, so yum isn't looking for what you think you told it to look for). – John Mar 9 '15 at 14:17
  • 5
    worked with yum install java-1.7.0-openjdk-devel-1:1.7.0.65-2.5.1.2.el6_5.x86_64 – coderplus Mar 9 '15 at 14:37
-1

You need to run the following as root user:

# yum install java-1.7.0-openjdk-devel-1.7.0.65-2.5.1.2.el6_5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.