Question

I'd like to install Typesafe Stack to Ubuntu Server via their Deb repo, but without downloading all the OpenJDK packages. I have Oracle JDK 6 installed and in my PATH via update-alternatives and installing OpenJDK breaks some stuff.

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:

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

Était-ce utile?

La solution 2

Old question, has been answered for a long time now in my comments under my OP, just making it official now. On Debian-based systems just use Debian Alternatives, see setup scripts in my comments above. It's brilliant, just works, and provides the following benefits:

  1. Use the exact version of Java/Scala/Haskell/etc you want, not what's in the Debian/Ubuntu/etc repos. Useful when the repo version lags the current version, or your app requires a specific version of the platform different from the repo.
  2. Haskell platform. Install multiple GHC and Haskell Platform versions side-by-side, say in /opt/haskell/ghc/[version] and /opt/haskell/platform/[version], and easily toggle between them with update-alternatives --config. Same with Java, Scala, or any other sdk/platform.
  3. Upgrade to new versions of GHC and Haskell Platform (or Java, Scala, etc) without overwriting or deleting the previous. If this causes regressions in your apps, easily roll back to the prior working version with a simple update-alternatives --config.
  4. Keep all files of GHC and Haskell Platform together in a single location like /opt/haskell/ghc/[version] and /opt/haskell/platform/[version], instead of spread out over /usr/bin, /usr/lib, and /usr/share as with an apt-get or dpkg -i installation. The files are kept in /opt/haskell/ and update-alternatives soft links them to their system directories.
  5. Easily uninstall with update-alternatives --remove-all (script included), and rm -rf /opt/haskell.
  6. Run haskell via system PATH instead of user PATH (eg, no need to add /opt/haskell/ghc/bin to your PATH in .profile)
  7. Get used to using update-alternatives, it's a great tool that makes managing manually installed, multi-version software painless. Java, Scala, and any other binary or compiled platform all work equally well with it.

Autres conseils

I'm currently looking at the 'scala' and 'scala-library' packages at Ubuntu's own 'universe' repository, instead of Typesafe repository. These packages depend on 'java6-runtime' (I run 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.

The equivs package can be used to create a fake package stub (e.g. Package: local-java-runtime) that falsely claims to provide the undesired JRE (e.g.: 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).

Take a look here to read up on equivs and see how it is done.

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top