Install and Update Drush on Linux | Drupal 8

Install and Update Drush on Linux

Submitted by editor on Sun, 05/08/2016 - 13:53
Question

Install and Update Drush on Linux

# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
# Example: drush 8.1.17
php -r readfile('https://github.com/drush-ops/drush/releases/download/8.1.17/drush.phar'); > drush
#OR
wget 'https://github.com/drush-ops/drush/releases/download/8.1.17/drush.phar'
mv drush.phar drush


# Test your install.

php drush core-status


# Make `drush` executable as a command from anywhere. Destination can be anywhere on $PATH.
chmod +x drush
sudo mv drush /usr/local/bin

# Optional. Enrich the bash startup file with completion and aliases.
drush init

 

Aa a script: (Run sudo a command first, like sudo ls)

php -r "readfile('https://github.com/drush-ops/drush/releases/download/8.1.17/drush.phar'); > drush
chmod +x drush
sudo mv drush /usr/local/bin
drush init

 

Update drush (or also install)

sudo php -r "readfile('https://github.com/drush-ops/drush/releases/download/8.1.17/drush.phar'); > /usr/local/bin/drush
chmod +x /usr/local/bin/drush
drush init

Add new comment