Monday, July 02, 2012

Installing Drush on Ubuntu

Source


Installing Drush on Ubuntu

Manuel Garcia's picture
So, you probably have heard of drush, and maybe you have not tried it yet. I tried it quite a while ago, and found it to be somewhat of a hassle. But I yesterday I decided to give it another go, and see all the buzz everyone's talking about.
I use ubuntu at home, and using the console to manage drupal sites seems like ideal, yet I didn't think drush was ready yet... seems like I wasn't paying enough attention!
So now to the meat of it. You will have to change username for the name of your user of course.
  1. Download drush, and uncompress it to your home directory. In my case, this leaves the files inside /home/manuel/drush
  2. Make sure the permisions to the drush file are set so that you can execute the file. See the screenshot below:
  3. If only you will be using the script, make a symbolic link to this file in your /home/username/bin (create the folder if you haven't already):
    ln -s /home/username/drush/drush /home/username/bin/drush
    After which, you should have a drush file in your bin directory like on the screenshot:
  4. UPDATE: To install Drush system wide, simply move the entire Drush directory to /usr/local/lib, and place your symbolic link in /usr/local/bin (thanks cjdavis)
And that is it my friends. You can now go to the root of your drupal installation, and let your jaw drop by executing drush sql dump, and then drush update, and look at it update all the modules on your site in 1 minute, while you go grab a beer.
A command you will want to use is drush help to find out what commands you have available. Enjoy, and long live drush!
[EDIT]
From Ubuntu Lucid on, you can install drush from Synaptic, or the command shell like sudo apt-get install drush However, in Lucid you'll only get the 2.x branch. In Maverick you get the 3.x branch. Not sure how maintained these packages are, if you care to help or wonder how this is going, head over to https://launchpad.net/ubuntu/+source/drush
AttachmentSize
folder-permissions.png76.52 KB
symbolic-link.png83.25 KB

No comments: