0

I installed drush, and when I do "drush status" it says that my drush version is 6.6.0.

I want to have drush7 instead, so I downloaded it from github, and did following commands:

chmod +x drush.phar

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

drush init

I get following error: the drush command init could not be found.

When I do drush status, it still says I have drush6 version... what do I need to do?

5
  • sudo composer global require drush/drush:7.1.0 doesn't work either Commented Mar 6, 2018 at 9:52
  • sudo composer global require drush/drush:8.x. This will work for both Drupal 7 and 8.
    – Ajay Reddy
    Commented Mar 6, 2018 at 9:56
  • That doesn't work either. It says "your requirements could not be resolved to an installable set of packages" Commented Mar 6, 2018 at 9:58
  • That means you have something pre-existing that conflicts with the new stuff you're trying to install. You'll need to check your global composer.json and probably prune it manually
    – Clive
    Commented Mar 6, 2018 at 12:24
  • Yes, first delete your exitsting Drush 6. Then install Drush 8, not 7, just like you did.
    – hansfn
    Commented Mar 8, 2018 at 7:07

1 Answer 1

0

Can always install manually

# get drush latest 8 version from 
# https://github.com/drush-ops/drush/releases
# or any version that you want 
wget https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar

# make it executable
chmod +x drush.phar

# move it to home directory or any other directory
mv drush.phar ~/drush

# go to that directory
cd ~

# find out the path to the directory
pwd
# the output would look similar to this
# /home/your_user

# edit the following file 
nano .bash_profile
# or in some systems
# nano .bashrc

# add this the end of the file
alias drush='/home/your_user/drush'

# use the alias you just setup
source ~/.bash_profile

NOTES: Above example works in ubuntu but should be similar on other distros

According to the docs drush 8 works with D8, D7 and D6 so no reason to install drush 7

If you want to call it with drush8 use following alias drush8='/home/your_user/drush' in .bash_profile file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.