- Install composer globally:
$ curl -sS https://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer
- Install drush globally (for your user), you can specify the version:
$ composer global require drush/drush:7.*
- Add the composer path to your path (in your *.bashrc* or *.zshrc* or other):
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
While not recommended, Drush can easily be installed on Ubuntu by using Aptitude or apt-get. If you have sudo rights the quickest way to install Drush is from the Ubuntu repository:
$ sudo apt-get install drush
However, the version this currently will give you is 4.5 (using Ubuntu 12.04). Newer versions have many improvements so you should use Drush to upgrade itself to the latest stable:
$ sudo drush dl drush --destination='/usr/share'
Then you can check the update has been successful by executing:
$ drush --version
You could also install Drush manually by downloading it directly from the project page and following the instructions of the README.txt file.
For Ubuntu 10.04 LTS apt-get will provide 2.0 Drush version, you need to follow Ubuntu help support to enable backports and so have 4.4-1 version available, which can then by upgraded to 5.6 as described above.
$ sudo apt-get install -t lucid-backports drush
Comments
A caution about the version of Drush
As of Sep/15/2011, Ubuntu 10.04 downloads and installs Drush 2.x with this method.
sudo apt-get install drushon
sudo apt-get install drush
on 11.04 gave me drush 4.4. must add doing 'drush dl drush' upgraded my drush version to 4.5
cool .. if you want you can
cool .. if you want you can just click the edit tab on top of the page and completely rewrite it
drush dl drush -- not
drush dl drush -- not working
message in ssh terminal:
There is no *recommended* release for project drush on Drupal 6.x. [ok]
Ask the maintainer to review http://drupal.org/node/197584 and
create/recommend a release in order to be compatible with drush and
the drupal.org security broadcast system. A recommended development
snapshot release is sufficient. Alternatively, run pm-releases
command and explicity pm-download any non-recommended release that
might be available.
Not working sudo apt-get
Not working
sudo apt-get install drush - not working
Linux server 2.6.35-22-server #35-Ubuntu SMP Sat Oct 16 22:02:33 UTC 2010 x86
_64 GNU/Linux
Ubuntu 10.10
drush status
parse_ini_file(/usr/share/drush/includes/../drush.info): failed to [warning]
open stream: No such file or directory environment.inc:1012
PHP configuration : /etc/php5/cli/php.ini
Drush version:
Drush configuration :
PS "Installing Drush on Shared Hosting Accounts" not working as well (http://drupal.org/node/1181480)
not found "drush" command
~/drush/drush status
unknow command "status"
Bad Bad
as you wrote: you use Ubuntu
as you wrote: you use Ubuntu 10.10
... and what does the docs say in one of the first lines? ;-)
Thanks to all for all the contributions and efforts here and everywhere else on Drupal.org!
You all rock! ~ dqd (formerly diqidoq)
Works fine on 10.04.
Works fine on 10.04.
druid.fi
Install & update drush
If you run
sudo apt-get install drush
drush is installed /usr/share/drush as default. So /usr/share/drush/drush has to executable in your $PATH environment variables (I think it is but check is by running in shellexport
).Update from 4.4 (available from Ubuntu repo)
After
sudo apt-get install drush
1. Run
sudo drush dl drush
.2. Run
sudo drush
.3.
drush --version
Update further
Drush might let you know that "A newer version of drush, 7.x-5.0-rc4, is available..." is available. Running
1.
sudo drush self-update
2.
sudo drush
3.
drush --version
Should work.
Do not forget to restart your pc
The above given steps work perfectly......but just one more simple thing, do restart your pc, and then type
drush --version
Can't install
Hi, I can do the above but I want to instal the dev version of drush and cant find any docs anywhere. Can anyone help advise. This is because drush 5.1 now has drush_make in core and it doesnt work right: see bug http://drupal.org/node/1539076
http://ftp.drupal.org/files/p
http://ftp.drupal.org/files/projects/drush-All-versions-5.x-dev.tar.gz
druid.fi
Not exactly...
You are running the provision script as the root user. Exiting
12.04
Ubuntu 12.04
Steps 1 and 2 worked for my Ubuntu 12.04 installation. Upgraded to version 7.x-5.8. Thanks!
Can't say this original method worked for me on 10.04LTS
But this one did: http://solutions-architecture.com/wiki/installing-drupal-drush-ubuntu-1004
Long and short:
sudo chmod +x /usr/local/lib/drush/drush
sudo ln -s /usr/local/lib/drush/drush drush
cd /srv/www/yoursite.com/sites/default
drush status
drush --version
. For me, it's 5.8.Enable run as normal user
In order to not have to run as root or sudo rights see http://drupal.stackexchange.com/questions/20496/is-it-possible-to-run-drush-without-root
summary:
In user's home directory who will run drush and ahs web privileges change permissions of .drush and drush-backups (created during install) for that user
sudo chown -R username:usergroup ~/.drush
sudo chown -R username:usergroup ~/drush-backups
upgrade drush on Ubuntu 13.04
if you are running Ubuntu 13.04 you can install drush using apt-get but it installes drush version 5.8.
To upgrade to version drush 5.9 please do following:
sudo drush dl drush --destination='/usr/share/php'
Hope it helps someone
PHP throwing error (Ubuntu saucy)
I installed via apt-get method on Ubuntu 13.10. Install worked fine, but when executing
drush version
, I get:I went to that
json_encode()
function and found the following:Any thoughts on what to edit?
Same
I'm having the same problem.
I have the same problem
I too, any solution? Help!!
Do a separate install of php5-json
Installing the package separately will do the trick.
For Ubuntu: sudo apt-get install php5-json
Link: http://stackoverflow.com/questions/18239405/php-fatal-error-call-to-unde...
Array to string conversion in /usr/share/php/PEAR/REST/13.php
Anyone like me currently getting this error when trying to install with PEAR:
This is due to a bug in drush: https://github.com/drush-ops/drush/issues/465
PEAR no loger supported ,you need github and composer
I had issues in installing drush via PEAR, but it looks like the pear channel is not maintained or has a bug.
More in the discussion on the github repo for drush
https://github.com/drush-ops/drush/issues/465
Copying the instructions to install drush via github below
Install composer and drush (debian but should be the same for most linux's)
Note: directories are up to you This was mine ...
clone git somewhere
git clone https://github.com/drush-ops/drush.git /usr/local/drush
create a link to drush from the bin dir
ln -s /usr/local/drush /usr/local/bin/drush
install composer
curl -sS https://getcomposer.org/installer | php
move it into the path and rename it
mv composer.phar /usr/local/bin/composer
(or you can link it like with drush above)
get dependencies
cd /usr/local/drush
composer install
You should be ready to go
Please add to this instruction with anything required for your own OS
PEAR channel updated, should work now
They have updated the PEAR channel. It should work now.
Permission denied
I'm using Ubuntu 12.04. I have installed php-pear already but when i issue
pear channel-discover pear.drush.org
I get this error:
could not create lock file: fopen(/usr/share/php/.lock): failed to open stream: Permission denied
How can I fix this?
Thanks
Got it
I just issued the commands with "sudo".
I try to use pear channel
I try to use pear channel-discover pear.drush.org but not work I install drush with apt-get commands
Thank you very much
Thank you! This has been very helpful! Just using:
sudo apt-get install drush
I was able to install drush in Ubuntu 14.04.
Cheers!
To list all available versions of drush
Run the following command -
drush pm-download --select --all drush
Then select the release you'd like to download.
drush installation problem
I have installed drush several times but in ubuntu 14.04. I am getting error as below
/var/www/drupalenglish$ drush status
Drush needs to download a library from [error]
http://download.pear.php.net/package/Console_Table-1.1.3.tgz in order
to function, and the attempt to download this file automatically
failed because you do not have permission to write to the library
directory /usr/local/lib/php/drush/lib. To continue you will need to
manually download the package from
http://download.pear.php.net/package/Console_Table-1.1.3.tgz, extract
it, and copy the directory into your /usr/local/lib/php/drush/lib
directory.
"you do not have permission"
Did you use sudo when installing drush?
Drush Installation
Follow the instructions here. Its quite simple to install the latest drush. http://www.zyxware.com/articles/4497/drupal-installing-latest-version-of...
Thanks abhai_zyxware, nice
Thanks abhai_zyxware, nice Article. That worked for me!
export PATH for Ubuntu 16.04
When following the instructions above, please ensure that when adding the directory to your path that it's different than stated:
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
Thanks kiwimind, that worked for me!
path was wrong for me
I already had drush installed (probably via pear and a digitalocean article circa 2015) and tried to update from 8.0.2 to 8.1.15. Anyway I installed the via composer globally without error and kept trying to run it but was getting 8.0.2 when typing drush --version. It was running drush from /usr/local/bin. Once I removed old drush manually and ran this...
export PATH="$HOME/.composer/vendor/bin:$PATH"
...it started launching the new version.
Using Ubuntu 14.04 LTS with composer 1.5.2 and drush 8.0 to 8.1.15.
It seems like literally every two months there's a new package manager or dependency manager in linux. Why is this necessary? NPM? Brew? Pear? Composer? chocolatey? when will it end? We have reached a point of terminal silliness.
I had Drush 8 installed on
I had Drush 8 installed on the server. Received some errors while updating my Drupal site from version 8.3.3 to 8.4.0. so I have updated Drush to 9.0.0-beta8. Now drush commands are not working on the server. Everytime I execute Drush command it shows error messages like -
[Exception]
The pm-updatecode command was deprecated. Please see `composer outdated` and `composer update`.
For security release notification, see `drush pm:security`.
How can I downgrade Drush to previous version 8? Trying to unstalled Drush and install it again but PEAR or apt-get is not working. Not sure how Drush was installed on the server.
Current Drush version:-
Drush Commandline Tool version 9.0.0-beta8
.Help is appreciated.
Thanks,
v 8.1.8
I still can't upgrade above v 8.1.8.
Followed exact same procedure.
Almost same configuration Composer v 1.5.2, Ubuntu 14.04.2. and PHP 5.5.9 (is PHP version the problem?)
Stuck to Drush 8.1.8 on a Drupal 8.4.
This whole process is very annoying and I can't find a single and clear (and good) update explanation given by Drush or Drupal.
v 8.1.8 -> 8.1.15
Finally made it manually like this (if it can help anybody):
download drush.phar v 8.1.15 from https://github.com/drush-ops/drush/releases;
copied to /Home;
removed current 'drush' from /usr/local/bin;
make downloaded 'drush.phar' executable: chmod +x drush.phar
moved drush.phar to /usr/local/bin: sudo mv drush.phar /usr/local/bin/drush
This process doesn't seem to work
Setting up a new server, and none of these things are working for me at all.
How can I install drush? I seem to have had no issues with composer, but it didn't seem to work.
Linux clockworkcorgi 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64
$ php --version
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
So:
But then:
Confused as exasperating, as usual. Anyone know what I need to do from here?
I feel your pain. Try this?
@cgfx I feel your pain. I have actually been using composer for more than a year with no problems, but while setting up a new Ubuntu17.10 workstation, I was having this error, and it wound up being a composer PATH issue in .bashrc:
What I had was:
export PATH="$HOME:/.composer/vendor/bin:$PATH"
I changed it to:
export PATH="~/.composer/vendor/bin:$PATH"
and that's what did it.
(I had to remind myself that .bashrc is what programs/applications use(not Cli) so if everything seems fine, but the program doesn't produce the correct output, that must be the culprit (my thinking)).
I'll bet it's a path issue in your case because I was having the same behavior: composer checked out with gold stars, but drush or any composer module was giving the "can't find ___" response). (Of course, since Composer was passing diagnostics, I wasn't looking there for the answer). Anyhow, post back if not, and I will try my best to lend my experience (I would hate for you to live life composer-less)..
I also found this resource to be quite helpful (a lot of varying "how-to's" around..):
http://docs.drush.org/en/8.x/install-alternative/
Ubuntu 20.04 Server
Hi all,
I'm on Ubuntu 20.04, installed composer and drush, couldn't figure out where it was because the paths I kept adding weren't working out.
finally I found it in
export PATH="$HOME/.config/composer/vendor/drush/drush:$PATH"
Hope this helps someone out there.