2010/06/30

How to install sun java 5 on Ubuntu 10.04 Lucid

We sometimes have requests to install the sun java 5 JDK on recent Ubuntu distributions. The problem is that Ubuntu 9.04 Jauty was the last release of Ubuntu to include sun java5 packages. So here is how I do it:

First, download the required packages:

wget http://de.archive.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/{ia32-sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb,sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb,sun-java5-demo_1.5.0-22-0ubuntu0.8.04_amd64.deb,sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_amd64.deb,sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb}


Now, install them with dpkg -i:

dpkg -i ia32-sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb sun-java5-bin_1.5.0-22-0ubuntu0.8.04_amd64.deb sun-java5-demo_1.5.0-22-0ubuntu0.8.04_amd64.deb sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_amd64.deb sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb


You will get unresolved dependency problems, but we are going to fix them:

aptitude full-upgrade


Keep pressing n until aptitude doesn't want to remove or downgrade any packages, only install. The solution will look like this:

The following actions will resolve these dependencies:

Install the following packages:
ia32-libs [2.7ubuntu25 (lucid)]
lib32asound2 [1.0.22-0ubuntu7 (lucid)]
lib32bz2-1.0 [1.0.5-4 (lucid)]
lib32gcc1 [1:4.4.3-4ubuntu5 (lucid)]
lib32ncurses5 [5.7+20090803-2ubuntu3 (lucid)]
lib32stdc++6 [4.4.3-4ubuntu5 (lucid)]
lib32v4l-0 [0.6.4-1ubuntu1 (lucid)]
lib32z1 [1:1.2.3.3.dfsg-15ubuntu1 (lucid)]
libc6-i386 [2.11.1-0ubuntu7.1 (lucid-updates, lucid-security)]
odbcinst [2.2.11-21 (lucid)]
odbcinst1debian1 [2.2.11-21 (lucid)]
unixodbc [2.2.11-21 (lucid)]

Score is -58


After accepting the solution and installing the missing packages, you will have both 32 and 64bit sun java5 installed:

# update-alternatives --list java
/usr/lib/jvm/ia32-java-1.5.0-sun/jre/bin/java
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/lib/jvm/java-6-openjdk/jre/bin/java


And you can use one of these values, as JAVA_HOME:

# java 1.5 32bit:
JAVA_HOME="/usr/lib/jvm/ia32-java-1.5.0-sun"
# java 1.5 64bit:
JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun"
# java 1.6 64bit:
JAVA_HOME="/usr/lib/jvm/java-6-sun"

2010/06/17

How to install open source vmware tools on Ubuntu lucid

I did not find a simple and straightforward solution anywhere, so here it is:

apt-get install --no-install-recommends open-vm-source module-assistant
module-assistant prepare open-vm
module-assistant auto-install open-vm
apt-get install --no-install-recommends open-vm-tools

This approach has a nice side effect: when you update your kernel, the modules gets recompiled too.

2010/06/06

Maximize rdesktop on startup

On my netbook, I use different displays, and I always had a difficulty when choosing the geometry option. So I wrote this as /usr/local/bin/rdesktop

#!/bin/bash

# Determine the maximum window size:
declare -i w="$(xprop -root | awk -F'[, ]' '/^_NET_WORKAREA/ { print $7 }')"
declare -i h="$(xprop -root | awk -F'[, ]' '/^_NET_WORKAREA/ { print $9 }')"
command -p rdesktop -D -g "${w}x${h}" "$@"