This instruction should work for Debian, Ubuntu, CentOS:
sudo wget --quiet -O - http://ftp.drupal.org/files/projects/drush-All-Versions-HEAD.tar.gz | tar -zxf - -C /usr/local/share
sudo ln -s /usr/local/share/drush/drush /usr/local/bin/drush
- Change into your Web server's root directory (cd /var/www).
- Run drush dl drupal-7.0. This downloads Drupal 7.0 from drupal.org and extracts the files into /var/www/drupal-7.0.
- Change into the newly created directory (cd /var/www/drupal-7.0) and run thesite-install command:
drush site-install --db-url=mysql://root:secret@localhost/drupal
Answer “y” to the following prompt, and in a few short moments, you'll have a working Drupal install (using the “drupal” database on localhost). To verify, you can browse to http://localhost/drupal-7.0/ and log in using admin/admin as the user name/password, respectively. The site-install command has several additional options; run drush help site-install for full details.
For those of you who work on several Drupal sites across various versions and installations, Drush provides an “alias” mechanism to define the common parameters. To create an alias for this example site here, you can create a file ~/.drush/aliases.drushrc.php containing the following PHP code:
$aliases['example'] = array( 'root' => '/var/www/example/drupal', 'uri' => 'example.com', );
Now you can run drush commands for your example site from any directory usingdrush @example