I have Drush 6 installed in my system.
I need to install Drush 5 too (hosting doesn't support Drush6), how do I install Drush5 without uninstalling Drush6 and use both of them simultaneously, Drush6 for local development and Drush5 for SFTP.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIn your .bashrc:
alias drush5=/path/to/drush5/drush
alias drush6=/path/to/drush6/drush
With this, drush5
will give you Drush 5, drush6
will give you Drush 6, and drush
will give you whichever of these appears first on your $PATH
.
Rename your aliases to suit.
apt-get install
. I'll give it a try
-bash: drush10: command not found
error. I closed and reopened my putty, then the issue is gone.
One option on Debian/Ubuntu is to use the "alternatives" system to register multiple different versions as alternatives, and switch between them. That way, the command drush
can be switched to point to different versions, without having to change any scripting you've done elsewhere.
However, this isn't as useful as you'd think, as switching between them is still a bit cumbersome: update-alternatives
requires you to provide the full path to the version of Drush you want to make temporarily "primary".
With that in mind, this blogpost (disclaimer: my own) explains how to script the alternatives system to switch between Drush versions using something like switchdrush VERSION
and sudo access. If you're not on a Debian-based *nix, then that scripting should be adaptable, to instead just change any /usr/bin/drush
symlink.
Thank you J-P!
The link to http://www.jpstacey.info/blog/2014-04-07/switching-between-drush-major-versions.html helped me a lot on Ubuntu.
However, you have to adapt the grep-command in case you are using a localized (non-English) OS/Terminal.
In my case (Ubuntu 14.04 LTS - German) i had to replace
command=`update-alternatives --display drush | grep "priority $version" | awk
With
command=`update-alternatives --display drush | grep "Priorität $version" | awk
drush sa
gives me the sites available and when I dodrush @sitename.env status
it gives Unexpected results. I have been in contact with Pantheon support team, they (Ricky Pugh) say its because I am using Drush 6. I wonder how you are working, can you verify you get same status fromdrush SITE status
for both local environment and Pantheon environment?drush site status
normally, I get the "to suppress this error, add the option --strict=0
", so I add it and run again, and get back the status of the site as normal.