RPM (JRE) 问题

RPM (JRE) 问题

我尝试在 Ubuntu 10.04 上安装 JRE,但失败了:

oneat@oneat-desktop:~/Downloads$ sudo rpm -i --force-debian jre-6u21-linux-i586.rpm
error: Failed dependencies:
    /bin/basename is needed by jre-1.6.0_21-fcs.i586
    /bin/cat is needed by jre-1.6.0_21-fcs.i586
    /bin/cp is needed by jre-1.6.0_21-fcs.i586
    /bin/gawk is needed by jre-1.6.0_21-fcs.i586
    /bin/grep is needed by jre-1.6.0_21-fcs.i586
    /bin/ln is needed by jre-1.6.0_21-fcs.i586
    /bin/ls is needed by jre-1.6.0_21-fcs.i586
    /bin/mkdir is needed by jre-1.6.0_21-fcs.i586
    /bin/mv is needed by jre-1.6.0_21-fcs.i586
    /bin/pwd is needed by jre-1.6.0_21-fcs.i586
    /bin/rm is needed by jre-1.6.0_21-fcs.i586
    /bin/sed is needed by jre-1.6.0_21-fcs.i586
    /bin/sort is needed by jre-1.6.0_21-fcs.i586
    /bin/touch is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/cut is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/dirname is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/expr is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/find is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/tail is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/tr is needed by jre-1.6.0_21-fcs.i586
    /usr/bin/wc is needed by jre-1.6.0_21-fcs.i586
    /bin/sh is needed by jre-1.6.0_21-fcs.i586

我该如何解决这个问题?


编辑: 我试过里卡多的回答,但它仍然不起作用:

root@oneat-desktop:/home/oneat/Downloads/untitled folder# rpm --nodeps --force-debian -i jre.rpm
Unpacking JAR files...
    rt.jar...
    jsse.jar...
    charsets.jar...
    localedata.jar...
    plugin.jar...
    javaws.jar...
    deploy.jar...
[: 924: /usr/java/jre1.6.0_21: unexpected operator
[: 924: /usr/java/jre1.6.0_21: unexpected operator

这些只是一些错误:

dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so'
dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libj2gss.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386').
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so'
dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjava.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386').
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dpkg-shlibdeps: warning: Can't extract name and version from library name `libverify.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libverify.so'
dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjsoundalsa.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386').
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjli.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libjli.so'
dpkg-shlibdeps: warning: couldn't find library libmawt.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjawt.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386').
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjawt.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386').

答案1

既然您运行的是 Ubuntu,难道您不能只安装来自 Ubuntu 存储库的 JRE 吗?例如,sudo apt-get install sun-java6-jre(目前版本为6.20dlj-1ubuntu3)。

如果您仍然需要走 RPM 路线,您有两种选择:

  1. 告诉rpm您忽略这些依赖项 ( rpm --nodeps -i ...),因为列出的所有程序都是已安装在标准 Ubuntu 系统上的程序。 (唯一不匹配的是gawk,它/usr/bin/gawk在 Ubuntu 上,但/bin/gawk在依赖项输出中;为了安全起见,您可以创建符号链接,或者只是忽略它并希望 JRE 脚本不会硬编码到 的路径gawk。)

  2. 使用外星人( sudo apt-get install alien) 将.rpm 文件转换为一个.deb文件;这也应该修复依赖关系或让您更正它们。

相关内容