Now that Drush has [url=https://github.com/drush-ops/drush/commit/59159ef5fa2c4a648f3ee750d3f527cb8d557f62]removed support for Pear[/url], and running the drush.php manually is currently not working, you are “forced” to use Composer.
If you don’t follow this way, you will get an error like:
Unable to load autoload.php. Drush now requires Composer in order to install its depedencies and autoload classes. Please see README.md
If you do not currently have composer installed you will need to download and install it, see [url=https://getcomposer.org/doc/00-intro.md]https://getcomposer.org/doc/00-intro.md[/url] for instructions.
You will need to run the following:
curl -sS https://getcomposer.org/installer | php
This will then install Composer.
Now we will install composer and set the path to .composer:
sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
Now to work with Drupal 8, you will require the latest Drush (7.x), which you can install like:
~/composer.phar global require drush/drush:dev-master --prefer-source && source ~/.bashrc
To update drush (as Drush is usually updated several times a day), simply run: