在SLES 11 SP3上安裝jre-8u51-linux-x64.rpm:失敗的依賴項


1

我嘗試使用以下命令在SLES 11 SP3系統上更新Java安裝

rpm -i jre-8u51-linux-x64.rpm

(出於某些原因,我想運行原始Java而不是SUSE提供的IBM Java),並且出現以下錯誤消息:

error: Failed dependencies:
    /usr/sbin/alternatives is needed by jre1.8.0_51-1.8.0_51-fcs.x86_64

我看到SLES 11具有/usr/sbin/update-alternatives而不是/usr/sbin/alternatives。我不熟悉rpm包裝的詳細信息,如何固定rpm軟件包安裝在我的盒子上?請提供詳細信息,而不只是更大的圖片。

P.S。Java安裝適用於運行某些服務(包括Fedora Commons信息庫)的Servlet容器(Apache tomcat)。

編輯(更新):使用jre-8u65-linux-x64.rpm不再需要依賴項,但是rpm仍需要/ usr / sbin / alternatives才能成功完成(因此,可以將其作為軟鏈接提供,也可以按照接受的答案中的說明編輯rpm文件)。

1

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)

Disclaimer

This 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.

Situation

As 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.


Resolution

  1. Use YaST -> Software -> Software Management and remove all previous versions of Java (e.g. java-1_6_0-sun, icedtea-web). Do not remove the openjdk version of Java if you have it installed. This is required for Java functionality in LibreOffice.

  2. Download Oracle Java

    Check if you have i586 or x86_64 version of Mozilla Firefox (this can be different from the architecture of the system). The easiest way is to open a console and type:

    rpm -q --queryformat '%{arch}\n' MozillaFirefox

    If x86_64 appears, use the version marked as "Linux x64 RPM".

    Visit http://java.com/ and click on Free Java Download. Download the "Linux RPM" (32 bit) or "Linux x64 RPM" (64 bit) as appropriate.

  3. As the root user install the downloaded rpm from a terminal by using the command:

    rpm -Uvh <file-name>

    Of course replace with the path and name of the rpm file downloaded from java.com.

  4. Enable the plugin for Firefox.

    Logged in as the user that will be running firefox open a terminal window and do the following:

    mkdir -v ~/.mozilla/plugins (if it already exists that's okay)

    rm ~/.mozilla/plugins/libnpjp2.so

    ln -s /usr/java/jre1.7.0_05/lib/amd64/libnpjp2.so ~/.mozilla/plugins/ (The "jre1.7.0_05" will need to match the version just installed)

  5. Close all instances of the Firefox browser then open it up again.

    Browse to http://java.com/en/download/installed.jsp to verify that java is installed properly.


Update

After reading the forum mentioned in my comments, it was decided that the following approach works (See Page 2 Post by rjfleck):

Use rpmrebuild Make sure you are not root, as you want the modified rpm in your user directory.

Set your favorite editor e.g.

setenv EDITOR xemacs

or 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.rpm
  1. After the rpm is unpacked, your chosen EDITOR should open. Use the Search and Replace function of the chosen editor to replace all occurrences of alternatives with update-alternatives.
  2. Save and Exit the updated file, and the rpm should be repackaged.
  3. Answer Y if asked to continue.

it should output where the rpm was saved to e.g.

/usr/people/<your username>/rpmbuild/RPMS/x86_64/jdk-<version>-fcs.x86_64.rpm