Commands To Install Drush 8 On UBUNTU 16.04

It's suggested to use composer to install Drush 8. So,

INSTALL COMPOSER :

  1. Download Composer using CURL : Ensure, you are firing below command from your home directory. If Unsure about the location, just fire, cd ~ just to be sure. And then,

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

    If downloading is successful, it will show message as :
    Composer (version 1.6.4) successfully installed to: /home/sandipt/composer.phar
    Use it: php composer.phar

  2. Move composer to your "/usr/local/bin" folder

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

  3. Check composer version by,

    composer --version

  4. Add Composer directory to your path i.e. .bashrc file

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

  5. Re-source the configuration you just added, or just close the terminal and open a fresh one and fire below command.

    source $HOME/.bashrc

NOW, INSTALL DRUSH 8 ACTUALLY :

  1. Remove/Uninstall any or all earlier version(s) of drush to avoid conflicts
  2. Now, execute command,

    sudo composer global require drush/drush:8.x

    from your home folder Please be patient, while the command is getting executed in here. Don't forget to use branch "8.x", cause "dev-master" is development branch which in turn is "Drush 9"

  3. Now, if everything goes okay, you will see message "Generating autoload files" etc. This means, the drush has been installed correctly in folder "~/.composer/vendor/drush/drush". It's time, we set the path:
    1. " sudo ln -s /home/<linux user name>/.composer/vendor/drush/drush /usr/bin/drush "
    2. " sudo export PATH="$PATH:/home/<linux user name>/.composer/vendor/drush/drush:/usr/local/bin" "
  4. Ensure the drush installation by typing command

    drush status

  5. Last but not least, Since our PATH variable is yet not set permanently, it won't be reflected in every bash terminal instance you use, so to achive it, lets add it to .bashrc
    1. Open .bashrc with sudo nano .bashrc in terminal at your home folder
    2. Add the above line mentioned in Step 3.2, at top of the file. Save and Close it.
  6. .bashrc file will be executed everytime you open terminal.
  7. Open a new terminal and run "drush status" to see if it has worked.

Add new comment