Saturday, March 30, 2013

Ubuntu MD5SUM Hashes

Have you ever needed to check MD5SUM hashes of any downloaded file? Ubuntu ISOs can always be checked here:
https://help.ubuntu.com/community/UbuntuHashes
After downloading your ISO file, you should always check it's MD5 hash:

$ md5sum Documentos/ISOs/lubuntu-12.10-desktop-*
bddb521817360540c0e54616427c003e  lubuntu-12.10-desktop-amd64.iso
a7fed6c40b4969d4a3c9c0a9ee228cf2  lubuntu-12.10-desktop-i386.iso
You can read the lines above as follows:
1) MD5 hash for lubuntu-12.10-desktop-amd64.iso is bddb521817360540c0e54616427c003e
2) MD5 hash for lubuntu-12.10-desktop-i386.iso is a7fed6c40b4969d4a3c9c0a9ee228cf2

With both hashes, access the page mentioned above and search for the name of ISO file. If the hash from the page is EXACTLY the same you got, so the file is okay, and you can make the correct use of it.

Make me know if it was somehow useful for you!

Monday, March 4, 2013

Manual instalation of Oracle Java on Ubuntu

This is the English version of this article of mine.

I had some versions of Java JDK installed in my Ubuntu Server 10.04, and I needed to install a new version (7u15). Here how I did it, trying to go straight to the point. This works for every Ubuntu (Desktop or Server) up to 12.10 (Quantal Quetzal).

  1. This is my crowded JVM directory:

    $ ls -lh /usr/lib/jvm/

    total 12K
    lrwxrwxrwx 1 root root   21 2012-05-27 20:19 java -> /usr/lib/jvm/jdk1.7.0_15
    drwxr-xr-x 4 root root 4,0K 2012-07-16 21:19 java-1.5.0-gcj-4.4
    drwxr-xr-x 8 root root 4,0K 2012-07-26 11:17 java-7-oracle
    drwxr-xr-x 8  500  143 4,0K 2013-02-15 18:21 jdk1.7.0_15


     
  2. I do not want a messy system. So I wiped it all up.

    $ sudo rm /usr/lib/jvm/j*
     
  3. Download Java JDK from Oracle. Today, this is the correct link for it. Choose the .tar.gz version. I downloaded both architecture versions:
    1. jdk-7u15-linux-i586.tar.gz
    2. jdk-7u15-linux-x64.tar.gz
  4.  Unpack the tar file to the correct directory, which is /usr/lib/jvm/. If this does not exist, create it.

    $ sudo tar xf jdk-7u15-linux-x64.tar.gz -C /usr/lib/jvm/
     
  5. Make each binary of ths new version of Java visible to Alternatives system:

    $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_15/bin/java" 1

    $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_15/bin/javac" 1

    $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_15/bin/javaws" 1

    This is for 32bits systems:
    $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/
    jdk1.7.0_15/jre/lib/i386/libnpjp2.so" 1

    This is for 64bits systems:

    $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/
    jdk1.7.0_15/jre/lib/amd64/libnpjp2.so" 1
  6. Choose each one of the binaries correctly:

     $ sudo update-alternatives --config java
     $ sudo update-alternatives --config javac
     $ sudo update-alternatives --config mozilla-javaplugin.so
     $ sudo update-alternatives --config javaws

This last step will list the versions available, if any. Choose the one from /usr/lib/jvm/jdk1.7.0_15, for this example.


After that, you just need to test the version. Do this for each one of the binaries:
$ java -version  
$ javac -version
This article was built upon Ubuntu Documentation.