How to install and upgrade Drush version in Linux ?

By

May 9, 2013Drupal2 Comments

When I was working in one of my Drupal projects I faced a few issues with  Drush commands like Site install, to resolve this you have to upgrade Drush version. I faced the issue with command not executed and ended up with some errors. I searched in Google for trouble shooting this issue but after spending hours in Google I found some useful tips. Drush is sensitive towards Drupal version.

When you are under same situation like me you can find below the steps to debug and solve the issue,

Steps to debug:

#1 How to find the possible  cause of  Drush errors?

In my case I was working with Drupal 7 and Drush 4. When I was working on few commands like download, enable/disable modules..etc it was working fine. Then I tried command like Site install it ended up with errors, like

So after searching with Google I found the error has occurred due to mismatch in the combination  between Drush and Drupal. Now you have found the possible cause of the error, let’s see how to resolve this error ,

#2 How to check Drush version?

You can check version of Drush by moving into your Drupal application directory ,   Let’s see each command with example.

Drush status alias st : which is used to check the information about the Drush and Drupal as shown below, the command is pretty simple and powerful

When you execute the above command you will see the output like below,

How to install and upgrade Drush version in Linux ?

#3 How to choose Drush and Drupal ?

You have to choose Drush Tool specific to Drupal version. There are few versions available in Drush let’s see the workable combinations.

  1. Drush 4 will work in Drupal 5
  2. Drush 5 works with both Drupal 6 and 7
  3. Drush 6 will work with Drupal 6,7 and 8

Note Drush 6 is not yet released for more information checkout this Drush 6

#4 How to install or upgrade Drush version in Linux?

Upgrading Drush in Linux is pretty simple you can do it with 2 to 3 steps, Once you logged in with your Putty command line, do the following

Note you can use the same command to install or upgrade Drush version.
Once you upgrade the Drush, navigate to your Drupal application directory and check the Drush status, you will see the version of Drush as 5.1

How to install and upgrade Drush version in Linux ?

Hope this article will help someone, feel free to post your comment 🙂

2 Responses to “How to install and upgrade Drush version in Linux ?”
  1. vc says:

    Thanks for the article! Do you know if this will have any effect on Drush aliases? Will it wipe it out on upgrade? Do the Drush aliases need to be updated as well?

    • mydons says:

      Sorry WC! we haven’t tried Drush aliases on upgrade. Hopefully it should work on upgrade, let us know if you have tried the same.

Leave a Reply