Start by downloading the latest stable release from https://hive.apache.org/downloads.html
-> Now untar the file with
$ tar -xvf hive-2.x.y-bin.tar.gz
-> Create a directory in the /usr/local/ with
$ sudo mkdir /usr/local/hive
-> Move the file to root with
$ mv ~/Downloads/hive-2.x.y /usr/local/hive
-> Edit environment variablesfor hadoop and hive in .bashrc
$ gedit ~/.bashrc
-> Now, start hadoop if it is not already running. And make sure that it is running and it is not in safe mode.
$ hadoop fs -mkdir /user/hive/warehouse
The directory "warehouse" is the location to store the table or data related to hive.
$ hadoop fs -mkdir /tmp
The temporary directory “tmp” is the temporary location to store the intermediate result of processing.
-> Set Permissions for read/write on those folders.
$ hadoop fs -chmod g+w /user/hive/warehouse
$ hadoop fs -chmod g+w /user/tmp
-> Now fire up HIVE with this command in console