Install JAVA on Ubuntu Linux

Open Terminal and backup the source file:-

  • => cp /etc/apt/sources.list /opt/sources.list.orig
JAVA

Change following settings in /etc/apt/sources.list

deb http://old-releases.ubuntu.com/ubuntu natty main

deb http://old-releases.ubuntu.com/ubuntu natty main restricted universe multiverse

deb http://old-releases.ubuntu.com/ubuntu natty-updates main restricted universe multiverse

deb http://old-releases.ubuntu.com/ubuntu natty-security main restricted universe multiverse

Run following commands in the Terminal:-

  • sudo apt-get update
JAVA
  • sudo mv /var/lib/apt/lists /opt/lists.orig
JAVA
  • sudo mkdir -p /var/lib/apt/lists/partial
JAVA
  • sudo apt-get update
JAVA
  • sudo cd /var/cache/apt/archives
JAVA
  • sudo tar -cvf /opt/archives.tar *.deb
JAVA
  • sudo apt-get clean
JAVA
  • sudo  apt-get install default-jre –no-install-recommends
JAVA

NOTE :- In my case JAVA packages were just downloaded but not installed. so in such case do as following:-

  • sudo cd /var/cache/apt/archives
JAVA
  • sudo => dpkg -i *.deb
JAVA

Check your JAVA is installed or not.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top