Refering to https://www.drupal.org/node/2132447, I would like to install Drush in /usr/slocal/abc directory, and I tried the following steps:

$ cd /usr/slocal/abc
$ wget --quiet -O - http://ftp.drupal.org/files/projects/drush-7.x-5.9.tar.gz
$ tar -zxf drush-7.x-5.9.tar.gz
$ ln -s /usr/slocal/abc/drush/drush /usr/local/bin/drush

Then, I got this error:

ln: creating symbolic link '/usr/local/bin/drush': Permission denied

I asked my system admin who said that the company policy does not allow to install stuff into /usr/local/bin.

I've searched many installation guides, all of them requires to create a symbolic link '/usr/local/bin/drush' in order to run Drush. Is there any other way I can do it?

  • What Linux OS are you running? – timofey.com Nov 28 '14 at 6:36
  • CentOS release 6.3 (Final) – leekit Nov 28 '14 at 7:21

This may not answer the question directly, but a preferred and much simpler way to install Drush, is to install it through the Composer.

Installing Composer

See Composer's website for greater detail.

curl -sS https://getcomposer.org/installer | php
# If the above code fails, use this one.
# php -r "readfile('https://getcomposer.org/installer');" | php
sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc source $HOME/.bashrc

Installing Drush

See Drush instructions on GitHub for greater detail.

To install Drush 6:

composer global require drush/drush:6.*

Or to install Drush 7:

composer global require drush/drush:dev-master


Per @leekit, he was able to solve his original issue by substituting the symbolic link with export PATH="$PATH:/path/to/drush:/usr/local/bin". For that and other alternatives, refer to step 3 of Install - Manual, on Drush instructions on GitHub.

| improve this answer | |
  • 2
    Thanks for your suggestion. Finally, refer to github.com/drush-ops/…, I tried using $PATH to configure my system to recognize where Drush resides: export PATH="$PATH:/usr/slocal/abc/drush, then run source .bashrc. It works now! – leekit Nov 28 '14 at 7:30
  • You're right. That would be an alternative for a symbolic link. – timofey.com Nov 28 '14 at 7:45
  • What exactly is usr/slocal? Is it a custom bin dir per user? – murraybiscuit Nov 28 '14 at 7:55
  • @murraybiscuit Since it is /usr/slocal, it is not a user directory; it is a directory inside the root directory of the boot disk. – kiamlaluno Nov 28 '14 at 10:55

Another option is to install Drush with Homebrew which is the route I usually go down. https://www.drupal.org/node/954766

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.