Drush is now available from PEAR

Please look at Drupal.org/project/drush for more information on how to download Drush.

Hi All,

Just a quick (first) forum post about a quick Drush install script that I've put together.

Firstly - if you don't know what Drush is - it is a CLI tool that allows you to maintain/modify your Drupal install. See http://drupal.org/project/drush for details.

I've written a shell script that will install Drush in seconds on your machine. The link to the shell script and some very basic instructions is http://gist.github.com/394177.

Hope this helps you - any issues just shout!

Stephen

Comments

KarenS’s picture

I added more to your script -- to download and the Pear Console Table library (I am unable to run Drush without it) and also to download Drush Make and Provision. And I like symbolic links to I created a symbolic link to Drush instead of the alias. I'm adding my script here because there is no way to do anything on github.

It would be good to make this more visible and accessible. What do you think about posting this on the Drush project? I think that is where most people would look for it.

Thanks for this, it's very useful.

#!/bin/bash
 
# Download Drush v3 from D.O and make it work on `drush` (OS X / Linux / *nix)
# quickly put together by stemount, adapted by KarenS
 
# move to home dir
cd ~
# remove current drush (if existent)
rm -rf ~/.drush/
# create drush directory (and hide it)
mkdir ~/.drush/
# move to new dir
cd ~/.drush/
# get Drush v3
curl -C - -O http://ftp.drupal.org/files/projects/drush-All-versions-3.0.tar.gz
# extract Drush v3
tar -xf drush*.tar.gz
# bin Drush tar
rm -f drush-All*.tar.gz

# get Pear Console Table library
cd drush/includes
curl -C - -O http://download.pear.php.net/package/Console_Table-1.1.3.tgz
# extract Pear
tar -xf Console_Table*.tgz
# copy the file we need
cp Console_Table-1.1.3/Table.php table.inc
# bin Console_Table tar
rm -r Console_Table-1.1.3
rm -f Console_Table*.tgz

# get Drush Make
cd ..
cd drush/commands
curl -C - -O http://ftp.drupal.org/files/projects/drush_make-6.x-2.x-dev.tar.gz
# extract Drush Make
tar -xf drush*.tar.gz
# bin Drush tar
rm -f drush_make*.tar.gz

# get Provision
curl -C - -O http://ftp.drupal.org/files/projects/provision-6.x-0.3.tar.gz
# extract Provision
tar -xf provision*.tar.gz
# bin Provision tar
rm -f provision*.tar.gz

# make drush command executable
cd ~
chmod u+x .drush/drush/drush

# alias drush and put in bash profile
# echo "alias drush='~/.drush/drush/drush'" >> ~/.bash_profile

# add symbolic link to drush files so they are executable anywhere
rm /usr/bin/drush
ln -s ~/.drush/drush/drush /usr/bin/drush 
izmeez’s picture

Bookmarking this, thanks. Maybe just what I need.

q0rban’s picture

Hi! I'm pretty sure there's already a Debian package for installing drush, but for other platforms, this is nice! Definitely post a patch on the drush issue queue with what you're working on. You might need to use fake-add.

KarenS’s picture

I opened a Drush issue for this, I think it would be nice to include it with Drush. See http://drupal.org/node/809760.

ihsanullahkhan’s picture

This method of installation work successfully for me.

Find the download URL of the recommended release from the Drush project page and download with WGET
cd ~/
wget http://ftp.drupal.org/files/projects/drush-All-versions-3.0.tar.gz

Extract the archive
tar -xvzf drush-All-versions-3.0.tar.gz

Set up an Alias
Create an alias for Drush in .bash_profile (this can also go in .profile or .bash_aliases)

echo "alias drush='php ~/drush/drush.php'" >> ~/.bash_profile

Optionally, specify a PHP path (version 5.2 or greater required)

echo "alias drush='/usr/local/php5/bin/php ~/drush/drush.php'" >> ~/.bash_profile

Load aliases[1] (or reconnect)

source .bash_profile

skwashd’s picture

Drush 3.0 and up support using Table_Console installed by the PEAR installer. The patch to implement this was attached to issue #700220: drush ignores Console_Table installed by PEAR. To take advantage of this on a Debian based system (including ubuntu) run the following commands:

sudo apt-get install php-pear # make sure PEAR is installed
sudo pear install Console_Table # install console table

That's it!

norm1710’s picture

At the time of writing we're at drush version 3.3 It might be an idea to add, as the last two line of the script, the following:

# Update drush to the latest version, using drush!
drush dl drush

Ian

stemount’s picture

Thanks for your contributions + suggestions all.

I've once again updated this script to include auto-updating of the project + drush_make and also provision.

You can find it here: http://gist.github.com/394177

slattery’s picture

Like Ihsanullah above, I had to add a 'z' to the tar args to allow tar to gunzip the archives.

thanyawzinmin’s picture

That is really great for me.

greg.1.anderson’s picture

I recommend against using these scripts. Install via pear, as explained on the drush project page. If you must use a script, you might want to try starting with the one here: http://drupal.org/node/809760#comment-5279654

unleash’s picture

hello all - pretty new to drush but love what i see!

looks great

greetings unleash

hanamizuki’s picture

I wrote a post about this, thanks for the information above.

http://miss-hana.com/drupal-install-drush-on-maclinux/

stemount’s picture

The Drush project page now has details on the (most reliable) method of downloading Drush
http://drupal.org/project/drush

DocDJ-forum’s picture

I love using drush on my Windows system. It has saved me LOTS of headaches. Where can I find the instructions for installing this new version on Windows? Or is it a standalone program?

regards,
DJ