I tried to update my Java installation on a SLES 11 SP3 system usingrpm -i jre-8u51-linux-x64.rpm(for some reasons I want to run the original Java and not the IBM Java provided by SUSE) and I got the following error message:error: Failed dependencies:    /usr/sbin/alternatives is needed by jre1.8.0_51-1.8.0_51-fcs.x86_64I see that SLES 11 has /usr/sbin/update-alternatives in place of /usr/sbin/alternatives. I am not versed with the details of rpm packaging, how can I fix the rpm package to install on my box? Please give the details, not only the greater picture.P.S. The java installation is meant for a servlet container (Apache tomcat) running some services including a Fedora Commons repository.EDIT (update): With jre-8u65-linux-x64.rpm the dependencies are no longer needed, but the rpm still needs /usr/sbin/alternatives to complete sucessfully (so either provide it as a softlink or edit the rpm file as described in the accepted answer).
Installing jre-8u51-linux-x64.rpm on SLES 11 SP3: Failed dependencies
rpm;java;dependencies;sles;alternatives
A few caveats here:The below article assumes you're using Firefox as your browser.If you have more than one browser, update Step 4 appropriately.The article may be the wrong Service Pack, but this should get you started.From the Novell Knowledgebase Article 7010472: (Quoted)DisclaimerThis Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented AS IS WITHOUT WARRANTY OF ANY KIND.SituationAs a result of a license change SUSE is no longer able to provide Oracle/Sun Java in the distribution or through the update channels.  As a result Java will need to be downloaded from the java.com site and manually installed.This also means that we cannot provide support for Oracle Java.  Any support issues should be directed to Oracle.  The following information is provided as a potential solution but is not guaranteed. ResolutionUse YaST -> Software -> Software Management and remove all previousversions of Java (e.g. java-1_6_0-sun, icedtea-web).  Do not removethe openjdk version of Java if you have it installed.  This isrequired for Java functionality in LibreOffice.Download Oracle JavaCheck if you have i586 or x86_64 version of Mozilla Firefox (thiscan be different from the architecture of the system). The easiestway is to open a console and type:rpm -q --queryformat '%{arch}\n' MozillaFirefoxIf x86_64 appears, use the version marked as Linux x64 RPM.Visit http://java.com/ and click on Free Java Download.  Downloadthe Linux RPM (32 bit) or Linux x64 RPM (64 bit) asappropriate.As the root user install the downloaded rpm from a terminal by usingthe command:rpm -Uvh <file-name>Of course replace  with the path and name of the rpm filedownloaded from java.com.Enable the plugin for Firefox.Logged in as the user that will be running firefox open a terminalwindow and do the following:mkdir -v ~/.mozilla/plugins (if it already exists that's okay)rm ~/.mozilla/plugins/libnpjp2.soln -s /usr/java/jre1.7.0_05/lib/amd64/libnpjp2.so~/.mozilla/plugins/ (The jre1.7.0_05 will need to match theversion just installed)Close all instances of the Firefox browser then open it up again.Browse to http://java.com/en/download/installed.jsp to verify thatjava is installed properly.UpdateAfter reading the forum mentioned in my comments, it was decided that the following approach works (See Page 2 Post by rjfleck):Use rpmrebuildMake sure you are not root, as you want the modified rpm in your user directory.Set your favorite editor e.g.setenv EDITOR xemacsor alternatively:EDITOR=xemacs;export EDITOR If EDITOR isn't set it will default to vi.  See the rpmrebuild manpage.rpmrebuild -e -p jdk-<version>-linux-x64.rpmAfter the rpm is unpacked, your chosen EDITOR should open. Use theSearch and Replace function of the chosen editor to replace alloccurrences of alternatives with update-alternatives.Save and Exit the updated file, and the rpm should be repackaged.Answer Y if asked to continue.it should output where the rpm was saved toe.g./usr/people/<your username>/rpmbuild/RPMS/x86_64/jdk-<version>-fcs.x86_64.rpm