## For Sublime Text 2

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

## For Sublime Text 3

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

For Sublime Text 2 License Key:

How to install both sublime text 2 and 3?
First, create an /opt folder
$ sudo su
$ mkdir /opt/
For 32 bit version
1. Download the sublimetext 2 & 3 from their website.
2. Extract the tar+bz2 format
tar -xvjf sublime_text_3_build_3126_x32.tar.bz2 -C /opt
tar -xvjf sublime_text_2_build_2221_x32.tar.bz2 -C /opt

For 64 bit version
Download the sublime text 2:
$ wget http://bit.ly/2xn2m5h
Download the sublime text 3:
$ wget http://bit.ly/2wRO1fE

2. Extract the downloaded files in /opt folder.
$ tar -xvf sublime_text_2.tar.gz -C /opt
$ tar -xvf sublime_text_3.tar.gz -C /opt

Next, create a symbolic link
$ sudo ln -s /opt/sublime_text_3/sublime_text /usr/local/bin/subl3
$ sudo ln -s /opt/sublime_text_2/sublime_text /usr/local/bin/subl2