Uninstall old version of drush

$ sudo apt-get remove drush
$ sudo apt-get autoremove

First of all we need the Composer dependency management tool for PHP.
Make sure that you have PHP 5.3.2+, GIT and CURL installed on your OS.

$ sudo apt-get install php5 git php5-curl

(Use LAMP)

Create a folder where to download the composer installer.

$ cd /var/www
$ mkdir composer
$ cd composer

Download Composer into this folder with the following command:

curl -sS https://getcomposer.org/installer | php

Install Composer

Step 1:

$ nano composer.json
paste in the following code:
		"require": {
			"toin0u/digitalocean": "1.2.1"

Step 2:

$ php composer.phar install


$ mv composer.phar /usr/local/bin/composer

Install Drush 7

$ composer global require drush/drush:dev-master

$ sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc

$ source $HOME/.bashrc