#To install Drush 8.x (dev) which is required for Drupal 8:
composer global require drush/drush:dev-master
#To install Drush 7.x (stable):
composer global require drush/drush:7.*
sudo apt-get update && sudo apt-get upgrade
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
ln -s /usr/local/bin/composer /usr/bin/composer
git clone https://github.com/drush-ops/drush.git /usr/local/src/drush
cd /usr/local/src/drush
git checkout 7.0.0-alpha5 #or whatever version you want.
ln -s /usr/local/src/drush/drush /usr/bin/drush
composer install
drush --version