[英]How to use Typesafe Stack deb repo with Oracle Java 6 instead of OpenJDK?
I'd like to install Typesafe Stack to Ubuntu Server via their Deb repo, but without downloading all the OpenJDK packages.我想通过他们的 Deb 存储库将 Typesafe Stack 安装到 Ubuntu 服务器,但不下载所有 OpenJDK 包。 I have Oracle JDK 6 installed and in my PATH via update-alternatives and installing OpenJDK breaks some stuff.
我已经安装了 Oracle JDK 6,并且在我的 PATH 中通过update-alternatives和安装 OpenJDK 破坏了一些东西。
What would be the best way to do this?最好的方法是什么? It doesn't appear that I can use apt-get --no-install-recommends flag for this:
看来我不能为此使用 apt-get --no-install-recommends 标志:
$> sudo apt-get install --no-install-recommends typesafe-stack sbt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ca-certificates-java default-jre default-jre-headless g8 java-common libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre
openjdk-6-jre-headless openjdk-6-jre-lib
Suggested packages:
equivs icedtea-plugin sun-java6-fonts ttf-sazanami-gothic ttf-kochi-gothic ttf-sazanami-mincho ttf-kochi-mincho ttf-telugu-fonts ttf-oriya-fonts
ttf-kannada-fonts ttf-bengali-fonts
Recommended packages:
icedtea-netx icedtea-6-jre-cacao icedtea-6-jre-jamvm
The following NEW packages will be installed:
ca-certificates-java default-jre default-jre-headless g8 java-common libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre
openjdk-6-jre-headless openjdk-6-jre-lib sbt typesafe-stack
0 upgraded, 12 newly installed, 0 to remove and 7 not upgraded.
Need to get 33.0 MB of archives.
After this operation, 86.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
PS - I know the Typesafe Stack components work with my current setup, since I had it installed and running fine with their prior installer. PS - 我知道 Typesafe Stack 组件适用于我当前的设置,因为我已经安装了它并且在他们之前的安装程序中运行良好。
I'm currently looking at the 'scala' and 'scala-library' packages at Ubuntu's own 'universe' repository, instead of Typesafe repository.我目前正在查看 Ubuntu 自己的“universe”存储库中的“scala”和“scala-library”包,而不是 Typesafe 存储库。 These packages depend on 'java6-runtime' (I run Ubuntu 12.10, 'Quantal').
这些包依赖于“java6-runtime”(我运行 Ubuntu 12.10,“Quantal”)。 This might not be the case for the packages found at the Typesafe repository, but the principle should be the same.
对于在 Typesafe 存储库中找到的包,情况可能并非如此,但原则应该是相同的。
The equivs package can be used to create a fake package stub (eg Package: local-java-runtime
) that falsely claims to provide the undesired JRE (eg: Provides: java6-runtime
). equivs package 可用于创建伪造的 package 存根(例如
Package: local-java-runtime
),它谎称提供不需要的 JRE(例如: Provides: java6-runtime
)。
This way you can manually install whichever Scala-supporting JRE you desire, then install the stub package you created, and apt-get install scala
will no longer complain (the stub package will satisfy the dependency without APT having to pull in a JRE).通过这种方式,您可以手动安装所需的任何支持 Scala 的 JRE,然后安装您创建的存根 package,并且
apt-get install scala
将不再抱怨(存根 package 将满足依赖关系,无需 APT 引入 JRE)。
Take a look here to read up on equivs and see how it is done.看看 这里阅读 equivs 并了解它是如何完成的。
BTW, for at least the Linux distribution I'm running I see that 'openjdk-7-jre' already provides 'java6-runtime', so perhaps the 'java6-runtime' dependency will be less of an inconvenience than in the past.顺便说一句,至少对于我正在运行的 Linux 发行版,我看到“openjdk-7-jre”已经提供了“java6-runtime”,因此与过去相比,“java6-runtime”依赖项可能会带来不便。
Old question, has been answered for a long time now in my comments under my OP, just making it official now.老问题,在我的 OP 下的评论中已经回答了很长时间,现在才正式发布。 On Debian-based systems just use Debian Alternatives , see setup scripts in my comments above.
在基于 Debian 的系统上,只需使用Debian Alternatives ,请参阅我上面评论中的设置脚本。 It's brilliant, just works, and provides the following benefits:
它很棒,可以正常工作,并提供以下好处:
update-alternatives --config
.update-alternatives --config
在它们之间轻松切换。 Same with Java, Scala, or any other sdk/platform.update-alternatives --config
.update-alternatives --config
轻松回滚到之前的工作版本。update-alternatives --remove-all
(script included), and rm -rf /opt/haskell
.update-alternatives --remove-all
(包含脚本)和rm -rf /opt/haskell
轻松卸载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.