Last updated 14 July 2016. Created on 14 July 2016.
Edited by jc174. Log in to edit this page.

This has been tested in Rebecca and Rosa.

Open the terminal in your $HOME directory. The $HOME directory is typically at /home/yourname. You can easily get to it from anywhere in the terminal just by typing cd and pressing enter.

1. Enter the following:

php -r "copy('', 'composer-setup.php');"

You may get a message that you need to install php5-cli using apt-get. If needed do it by typing:

sudo apt-get update
sudo apt-get install php5-cli.

2. Enter the following:

php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

You should see a message "installer verified".

3. Install composer with the following command:

php composer-setup.php

You should see a success message like "Composer successfully installed to: /home/yourname/composer.phar".

4. Delete the install file:

php -r "unlink('composer-setup.php');"

5. Move composer to /usr/local/bin/composer:

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

6. Install the latest version of Drush:

composer global require drush/drush

This may take a few minutes. You may see some messages where pear or symfony suggests installing some things. Ignore for now. The above command should have installed it at $HOME/.config/composer/vendor/bin.

7. If you don't already have one, create a .bashrc file in your $HOME directory. Inside this file, add this line:

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

8. Log out and log back in so linux loads the .bashrc file. You should now be able to use Drush from any directory. To test, type "drush status". Check the version with "drush --version".

Looking for support? Visit the forums, or join #drupal-support in IRC.