How to install latest Drush 7 version? | Blog | Innoraft Skip to main content

Search

15 Nov, 2013
2 min read

How to install latest Drush 7 version? So you can use drush with the brand new Drupal 8.

Image
How to install latest Drush 7 version? So you can use drush with the brand new Drupal 8 - Banner

It is interesting how when you are trying to do something new in drupal you land up learning (and doing) other newer things!

At the code sprint in Drupal Camp Delhi 2013, I finally got myself started with Drupal 8. The first thing that I did after cloning drupal and moving to the 8.x branch was a

$ drush status

I expected to see something that said I was using Drupal 8.x-dev and of course some errors about no database found. But what I saw instead was the unexpected error below -

$ drush status
Drush 5.0-dev does not support Drupal . Use Drush 4 instead.

I asked around in the sprint room and thanks to the fellow Piyush, found that I need to upgrade to drush 7 in order to work with Drupal 8 (new thing learned #1). And the discovery about drush moving out of Drupal.org project infrastructure to github.com soon followed. Pretty cool news huh! (new thing learned #2).

Sidenote: I just created an issue at drush’s new home on github.com to request letting future ‘movers’ to Drupal 8 know that they need to get drush 7 over from github.com

The next thing I needed to do was upgrade my existing drush 5.x to drush 7.x, so I tried what I had used to upgrade drush from version 4 to 5 in the past

$ drush self-update

But nothing happened and I was still on version 5. So.. drush self update is not capable of taking your from version 5 to the latest version and to get to version 7 of drush (as of 15 November 2013) you actually have to install it directly from github (new thing learned #3)

I use ubuntu and I had originally installed drush with a

$ sudo apt-get install drush

which did everything for me and I was not sure where all the files were installed. I was keen to use the same location to install drush 7 alongside my existing drush 5 setup.

A quick

$ updatedb
$ locate drush | more
revealed many locations, two of which were important
/usr/bin/drush
/usr/share/drush/drush

It was clear that I needed to download and place latest drush files in my /usr/share directory and create a symlink to it in my /usr/bin directory, which the below commands did for me

$ cd /usr/share
$ sudo git clone https://github.com/drush-ops/drush.git drush7
$ sudo ln -sf /usr/share/drush7/drush /usr/bin/etc

And ah! - What a joy it was to move to the latest version of drush and Drupal :-) and I hope you make the move soon too.

$ drush --version
 Drush Version   :  7.0-dev

$ drush status
 Drupal version                  :  8.0-dev                                                                                  
 Site URI                        :  http://default                                                                           
 Database driver                 :  mysql