Download the latest distribution from the Hadoop website (http://hadoop.apache.org/). I used the latest stable version 2.7.3 on Ubuntu 14.04 as follows:
$ cd /home
$ wget http://mirrors.ibiblio.org/apache/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz
Next, create and extract the package in /opt/yarn as follows:
$ mkdir –p /opt/yarn
$ cd /opt/yarn
$ tar xvzf /root/hadoop-2.7.3.tar.gz