In the previous article we have discussed how to install OpenJDK java on ubuntu from the standard Ubuntu repository or Oracle's Java JDK 7 using Personal Package Archives ( PPA ). This article will cover installation of Oracle Java JDK 7 from a source package or by converting RPM Java package to the Debian software package format.

Download Oracle Java JDK 7

First, we need to download Oracle Java JDK source package from the official Oracle website. Navigate to JDK Downloads, accept license terms and download jdk-7<version>-linux-<architecture>.tar.gz. Current version of this source package is jdk-7u11-linux-x64.tar.gz and this is also what we are going to use in this tutorial. Store this tarball source package into your home directory or some other arbitrary place.


How to install Java on Ubuntu Linux? Although, this topic is a quite self explanatory to an experienced Linux system administrator it still creates lots of confusion for beginners in terms what version of Java I need, how do I install it or how to change my system settings between multiple different types of Java versions. The aim of this short article is to shed some light on this topic as we will show how to install Java JDK for both Oracle and as well as OpenJDK.

What is Java

In short, Java is an object-oriented programming language. The current owner of the official implementation of the Java SE ( Standard Edition ) platform is Oracle Corporation. The free and open source implementation of the Java Platform SE is called OpenJDK and OpenJRE. There is also another Java version maintained by IBM. IBM provides also both JDK and JRE. Currently only OpenJDK and OpenJRE Java versions are available via standard Ubuntu repository.

The following quick tutorial will provide you with the information on how to configure LAMP ( Linux, Apache, MySQL, PHP ) server on the Ubuntu 16.04 Xenial Xerus Linux. This guide consists of the three simple to follow steps: installation, database setup and testing.


Let's begin by installation of all required packages:
$ sudo apt-get update
$ sudo apt-get install libapache2-mod-php php-mysql mysql-server apache2

The following guide will provide you with some information on how to improve Ubuntu's repository download speed by selecting the closest, that is, possibly fastest mirror relative to your geographical location.

Country Code

The simplest approach is to make sure that your Ubuntu mirror defined within /etc/apt/sources.list includes a relevant country code appropriate to your location. For example, below you can find a official United States Ubuntu mirror as found in /etc/apt/sources.list:
deb xenial main restricted
If you are not located in United States simply overwrite the us country code with appropriate code of your country. That is, if your are located for example in Australia update your /etc/apt/sources.list file for all entries as:
deb xenial main restricted

Use mirror protocol

Using mirror protocol as part of your /etc/apt/sources.list entry will instruct apt command to fetch mirrors located within your country only. In order to use mirror protocol update all lines within /etc/apt/sources.list file from the usual eg.:
deb xenial main restricted

Why LXD?

It’s no secret that containers are hot right now in the Linux world. They are quickly becoming the backbone of the Cloud and are making DevOps dreams come true. Even so, at first glance, it seems a bit redundant for Canonical to develop a new container system for Ubuntu in a world easily dominated by Docker. So why, then, did they do it? To fill a middle ground between traditional virtual machines and Docker. Canonical said it themselves, “By combining the speed and density of containers with the security of traditional virtual machines, Canonical’s LXD is the next‐generation of container hypervisor for Linux.” Not only that, but Docker containers can be run within LXD containers, adding another dimension to potential container configurations.

LXD is an enhancement of the existing LXC Linux container hypervisor with it’s own toolset, sharing a similar relationship to the original project as Ubuntu does with Debian with the goal of taking existing great software and streamlining it for easier use. On Canonical’s latest Ubuntu LTS release, 16.04, LXD is well integrated and easy to use with clear and concise CLI tools that make container creation and management seamless.

Initial Setup

Getting started with LXD on Ubuntu 16.04 is as close to effortless as could be expected. Canonical condensed the install to a single package, making this a one command install. A simple sudo apt-get install lxd will get everything needed to get started.

Install LXD with apt-get install lxd

Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
Get extra help by visiting our LINUX FORUM or simply use comments below.