I have two rpm files, each containing a different version of the Java SDK. I want to install both, so I installed one, then the other, but when I installed the newest one, it overwrote the older one:

$ ls ./ibm-java*

$ sudo yum install ibm-java-x86_64-sdk-6.0-16.15.x86_64.rpm
$ ls /opt/ibm/
$ sudo yum install ibm-java-x86_64-sdk-8.0-2.0.x86_64.rpm 
$ ls /opt/ibm/

Is there a way to install both? I looked at the options for yum but didn't see anything relevant.

  • It's possible that they both want ot install themselves into the same paths, too, in which case it might be difficult. (FWIW, the openjdk versions of 1.6, 1.7, 1.8 can coexist no problem, but I assume you have technical reasons for using the IBM version.) Dec 8, 2015 at 8:18
  • Thanks @UlrichSchwarz, and you're right: I'm required to use the IBM version of Java for this. Dec 8, 2015 at 18:16

2 Answers 2


As noted in comment, it is possible that both packages use the same paths. For instance, Java packages commonly install (besides the files) symbolic links from /usr/bin to the actual files. You may find those explicitly in /usr/bin, or (depending on the system) via some alternatives directory, e.g., /etc/alternatives.

Even if there is no explicit conflict, the packager may choose to treat some older version as obsolete and make it hard(er) for someone to retain older versions.

You can always make a tar of the older directory contents before installing the newer package, and restore it afterwards (when yum has deleted the older one). If you do this, yum will not know about the older version, and you can do whatever is needed to allow applications to use that, e.g., setting PATH for specific applications.

  • Another way: # yumdb set installonly keep PACKAGE_TO_KEEP
    – Alberto
    Dec 8, 2015 at 9:17
  • You can do that, but if the packages conflict, you may not like the result. Dec 8, 2015 at 9:47

This question is quite old but is probably on top of search results so I can provide a working answer for others searching for this like me:

yum install --setopt=installonlypkgs=jdk1.8 jdk1.8

Alternatively the "provides" can be permanently included in yum.conf using this option. Care should be taken using this parameter - not sure whether setting it explicitly disables default to use this option for kernel packages so it could disable this option unintendely for kernel package installed at same time...

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.