sh: 1: drush: not found

567 views
Skip to first unread message

Damiano Arena

unread,
Apr 14, 2016, 9:33:24 AM4/14/16
to Open Semantic Framework
Hello,
when I try to install OSF for Drupal on the server by running sudo ./osf-installer -d --install-osf-drupal -v I get an error.

----------------------------------
| Installing Drupal & OSF Drupal |
----------------------------------

dpkg-query: no packages found matching git
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                                             Architecture Description
+++-=====================================================-===================================================-============-===============================================================================
ii  php5-curl                                             5.5.9+dfsg-1ubuntu4.14                              amd64        CURL module for php5
sh: 1: drush: not found


Can you please help me to understand and solve it?

Thank you very much

Best,
Damiano



Frederick Giasson

unread,
Apr 14, 2016, 12:02:37 PM4/14/16
to open-semant...@googlegroups.com
Hi,

This is the second time this is reported to me within a few days, probably that something change in one of the packages. I will investigate later today.

Thanks,

Fred

--
You received this message because you are subscribed to the Google Groups "Open Semantic Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-semantic-fra...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Frederick Giasson

unread,
Apr 14, 2016, 12:22:40 PM4/14/16
to open-semant...@googlegroups.com
Hi,

I just tested it and everything is working fine. What Linux distro/version are you using?

Thanks,

Fred

Message has been deleted

Damiano Arena

unread,
Apr 14, 2016, 12:35:21 PM4/14/16
to Open Semantic Framework
Hello Fred,
Thank you very much for your prompt response.

I'm using Ubuntu 14.04.4 LTS

Best,
DA
To unsubscribe from this group and stop receiving emails from it, send an email to open-semantic-framework+unsub...@googlegroups.com.

Frederick Giasson

unread,
Apr 14, 2016, 1:34:17 PM4/14/16
to open-semant...@googlegroups.com
What you get with: "apt install php5-curl" ?

Thanks,

Fred

To unsubscribe from this group and stop receiving emails from it, send an email to open-semantic-fra...@googlegroups.com.

Damiano Arena

unread,
Apr 14, 2016, 3:01:22 PM4/14/16
to Open Semantic Framework
I'll be able to check it tomorrow.
However I've installed everything on a new virtual machine but still, there is some problems.
This is what I get:


----------------------------------
| Installing Drupal & OSF Drupal |
----------------------------------

sh: 1: drush: not found


What does it mean?
Thank you

Best,
DA

Frederick Giasson

unread,
Apr 14, 2016, 3:02:32 PM4/14/16
to open-semant...@googlegroups.com
Hi,

> I'll be able to check it tomorrow.
> However I've installed everything on a new virtual machine but still,
> there is some problems.
> This is what I get:

Please send me the OSF installer log file (should be located in /tmp/)

Thanks,

Fred

Damiano Arena

unread,
Apr 14, 2016, 4:13:30 PM4/14/16
to Open Semantic Framework
Hi,
Please find attached the last log file.

I don't know why it's slightly different from what I see on my screen.
For example there is no "sh: 1: drush: not found"

Thank you
osf-install-2016-04-14_19:58:08.log

Damiano Arena

unread,
Apr 15, 2016, 5:27:52 AM4/15/16
to Open Semantic Framework
Hello Fred,
I think that the following log files might be more useful.
I went through the installation process once more but the result is still the same.

Finally, I also tried what you said yesterday apt install php5-curl but it says php5-curl is already the newest version

Thank you for your time and support

Best,
DA
osf-install-2016-04-15_09:01:04.log
osf-install-2016-04-15_09:14:08.log

Frederick Giasson

unread,
Apr 15, 2016, 8:08:34 AM4/15/16
to open-semant...@googlegroups.com
Hi,

Yeah, the problem is not php5-curl, but really drush. Still not found?

Try this by hand:

=========
curl -sS https://getcomposer.org/installer | php
composer global require drush/drush:7.1.0
mv /root/.composer/vendor/bin/drush /usr/bin/drush
drush -v
=========


And tell me what happens at each step.

Thanks,

Fred

--
You received this message because you are subscribed to the Google Groups "Open Semantic Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-semantic-fra...@googlegroups.com.

Damiano Arena

unread,
Apr 15, 2016, 8:40:54 AM4/15/16
to Open Semantic Framework
Hi Fred,
Here is the response to each step:
All settings correct for using Composer
PHP Warning:  file_put_contents(/home/damiano/.composer/keys.dev.pub): failed to open stream: Permission denied in - on line 407
PHP Warning:  file_put_contents(/home/damiano/.composer/keys.tags.pub): failed to open stream: Permission denied in - on line 424
Downloading 1.0.0...

Composer successfully installed to: /home/damiano/composer.phar
Use it: php composer.phar
_______________________

sudo composer global require drush/drush:7.1.0
[sudo] password for damiano:
Changed current directory to /home/damiano/.composer
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
________________

sudo mv /root/.composer/vendor/bin/drush /usr/bin/drush
[sudo] password for damiano:
mv: cannot stat ‘/root/.composer/vendor/bin/drush’: No such file or directory
________________

drush -v
The program 'drush' is currently not installed. You can install it by typing:
sudo apt-get install drush


What would you suggest to do now?

Thank you

Best,
DA
To unsubscribe from this group and stop receiving emails from it, send an email to open-semantic-framework+unsub...@googlegroups.com.

David Angst

unread,
Apr 15, 2016, 12:08:12 PM4/15/16
to Open Semantic Framework
I faced the same issue trying to install osf-drupal and i used the install method for drush at http://docs.drush.org/en/master/install/ :

# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases. wget http://files.drush.org/drush.phar # Or use our upcoming release: wget http://files.drush.org/drush-unstable.phar # Test your install. php drush.phar core-status # Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. chmod +x drush.phar sudo mv drush.phar /usr/local/bin/drush

After that, the install of osf-drupal went well.

I think that it have not installed version 7.1 but last stable version instead which is said to be compatible with Drupal 7 so I imagine that it should not be a problem.

I'll continue with this version for now.

Damiano Arena

unread,
Apr 17, 2016, 4:41:15 PM4/17/16
to Open Semantic Framework
Hi,
thank you for your answer
Well, something seems to be changed but I'm still facing some errors.

Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run
this command.

The drush command 'en osf_field' could not be executed.           

Drush was not able to start (bootstrap) the Drupal database.
       

I attach the log file.
Can you kindly help me to understand how to solve it?

Thank you

Best,
Damiano
osf-install-2016-04-17_20:30:17.log

Frederick Giasson

unread,
Apr 18, 2016, 8:34:07 AM4/18/16
to open-semant...@googlegroups.com
Hi,

thank you for your answer
Well, something seems to be changed but I'm still facing some errors.

Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run
this command.

The drush command 'en osf_field' could not be executed.           

Drush was not able to start (bootstrap) the Drupal database.
       

I attach the log file.
Can you kindly help me to understand how to solve it?

This normally happens when you run Drush in a non-Drupal folder. However, I am not sure when you get that error since I can't see it in the log.

Thanks,

Fred

Damiano Arena

unread,
Apr 18, 2016, 10:08:20 AM4/18/16
to Open Semantic Framework
Hi Fred,
thank you for your answer.
Please find attached a txt file that shows a little excerpt of what I've got on my screen when I tried to install OSF for Drupal.

I guess the problem is related to Drupal database. In fact, if I try to open the localhost page, I don't get the "normal" Initial Drupal page but a web page to Install/Set something for Drupal (install.php). Among the installation steps there is: "Set up database".

Thank you

Best,
DA
Log.txt

Frederick Giasson

unread,
Apr 19, 2016, 8:07:24 AM4/19/16
to open-semant...@googlegroups.com
Hi,

Everywhere in this log I see things like: "Drush was not able to start
(bootstrap) the Drupal database".

There is really something not working on that instance and it is the
first time I see this issue. Is MySQL running? Maybe delete the drupal
folder and retry, etc.

Thanks,

Fred

Damiano Arena

unread,
Apr 20, 2016, 10:05:33 AM4/20/16
to Open Semantic Framework
Hi Fred,
MySQL is running.
Moreover, I renamed the drupal folder and retry but nothing changed.

I really don't know what else I can do.

Thanks,
DA

Frederick Giasson

unread,
Apr 20, 2016, 10:11:50 AM4/20/16
to open-semant...@googlegroups.com
Hi,

> Hi Fred,
> MySQL is running.
> Moreover, I renamed the drupal folder and retry but nothing changed.
>
> I really don't know what else I can do.

What is really hard for me is to figure out what you did and where
things stand.

Is it possible for you to restart from a fresh Ubuntu 14.04 image (on
AWS or whatever?)


Thanks,

Fred

Damiano Arena

unread,
Apr 20, 2016, 10:56:43 AM4/20/16
to Open Semantic Framework
Hi Fred,
I did it few hours ago.
I restart from a fresh Ubuntu 14.04 machine (through Oracle VM Virtual Box)

I followed the standard installing procedure:

mkdir -p /usr/share/osf-installer/
cd /usr/share/osf-installer/
wget https://raw.github.com/structureddynamics/Open-Semantic-Framework-Installer/3.4/install.sh
chmod 755 install.sh
./install.s
./osf-installer -c --install-osf -v
./osf-installer -d --install-osf-drupal -v


I didn't change any parameter.
But at the end of the procedure I get the error that I've mentioned at the beginning of this thread.

Then, I applied your suggestions:

curl -sS https://getcomposer.org/installer | php
composer global require drush/drush:7.1.0
mv /root/.composer/vendor/bin/
drush /usr/bin/drush
drush -v

But, then, I got the other 3 errors

Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en osf_field' could not be executed.           
Drush was not able to start (bootstrap) the Drupal database.
 


I think the following document might be relevant to our problem: https://www.drupal.org/node/1302418
What do you think about it?

Thanks,
DA

Frederick Giasson

unread,
Apr 20, 2016, 11:01:23 AM4/20/16
to open-semant...@googlegroups.com
Hi,

> But, then, I got the other 3 errors
>
> /Command pm-enable needs a higher bootstrap level to run - you will
> need to invoke drush from a more functional Drupal environment to run
> this command.
> The drush command 'en osf_field' could not be executed.
> Drush was not able to start (bootstrap) the Drupal database./

In which folder are you when you run these commands? You should be in
/usr/share/drupal/


> I think the following document might be relevant to our problem:
https://www.drupal.org/node/1302418
> What do you think about it?


No I don't thin, this is about making PHP visible to Drush. Here the
issue is that Drush can't find/bootstrap Drupal from the folder where
you execute it.


Thanks,


Fred

Frederick Giasson

unread,
Apr 20, 2016, 1:53:48 PM4/20/16
to open-semant...@googlegroups.com
For everybody:

One thing we found while investigating this issue is that Drush's
installation procedure was not working anymore because they apparently
changed the path of the exec file. This got fixed in the OSF Installer.

You can retry.

Note: right now, you have to be logged in as root (sudo -i) to run the
Drupal installer since it assumes that the composer got installed in
/root/. This should be updated eventually to check the user where the
installation got run.

Thanks,

Fred

Damiano Arena

unread,
Apr 21, 2016, 11:39:58 AM4/21/16
to Open Semantic Framework
Thank you for your support Fred!

This is what I did to install everything:


mkdir -p /usr/share/osf-installer/ cd /usr/share/osf-installer/ wget https://raw.github.com/structureddynamics/Open-Semantic-Framework-Installer/3.4/install.sh


chmod 755 install.sh

./install.sh

./osf-installer -c --install-osf -v


then I logged in as root and


apt-get isntall git

cd
/usr/share/osf-installer/

./osf-installer -d --install-osf-drupal -v


Now it works!

Best,
DA

Shan Wan

unread,
Jun 29, 2017, 9:59:38 AM6/29/17
to Open Semantic Framework
Hi Fred, 

I encounter the same problem recently, and I tried many times today as what you said in this post, but still didn't get through.
The problem here is:
sh: 1: drush: not found

This is what I did as you told us:
(1) curl -sS https://getcomposer.org/installer | php  
    (I think I have had the composer already, and I used it before, but I still run this step in order to follow your steps)
Here is what I got:
All settings correct for using Composer
Downloading...

Composer (version 1.4.2) successfully installed to: /home/vagrant/composer.phar
Use it: php composer.phar

(2) composer global require drush/drush:7.1.0
(I run this "composer global require drush/drush" at first, but here is what I got:
'Changed current directory to /home/vagrant/.composer
Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Using version ^8.1 for drush/drush
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Then I changed to  ' drush/drush:7.1.0'
)
This step went good.

(3) mv /root/.composer/vendor/bin/drush /usr/bin/drush
 (This step confused me.)

Firstly, as I am currently in vagrant account, so I run 'mv /home/vagrant/.composer/vendor/bin/drush  /usr/bin/drush',  then I run 'drush -v', nothing happened.
Then I changed it to 'mv /root/.composer/vendor/bin/drush  /usr/bin/drush'', but permission denied.
Then I change account as root, and run the above instruct, and 'drush -v'
then this shows:
 'The program 'drush' is currently not installed. You can install it by typing: sudo apt-get install drush'
=======
Then I tried another method to install drush provided by David Angst in this forum. but move the drush file to '/usr/bin/drush' rather than '/usr/local/drush' as he suggested at the last step, when 'drush -v', everything is OK until now. it seems that the drush has been installed successfully.

And I start to install osf-drupal step by step, but (again) sh: 1: drush: not found!

It didn't work whatever I did, what should I do? Please help!  And the installer log file in /tmp has been attached here.
                                                               
Many thanks,

Shan

在 2016年4月21日星期四 UTC+8上午1:53:48,Frederick Giasson写道:
log file.txt

Kitio Fofack

unread,
Jun 29, 2017, 10:10:05 AM6/29/17
to Open Semantic Framework
Hi Damiano,

You did very well installing drush 7.1.0 if not the installer will try to install it and will mess up !

Now the only thing you need is to have the path to drush into root PATH. 

It should look like : export PATH="$PATH:/home/kitio/.composer/vendor/drush/drush"

You can add this to the root .bashrc.

You will be all set when you will be able to run drush status as root.

Remember drush has to be installed using composer with a non admin account.

Hope this helps you !

Shan Wan

unread,
Jun 29, 2017, 10:11:19 AM6/29/17
to Open Semantic Framework
As for the 'The program 'drush' is currently not installed. You can install it by typing:apt-get install drush'

I ran 'apt-get install drush', then 'drush -v', but got the same notice as above. don't know why.


在 2016年4月21日星期四 UTC+8上午1:53:48,Frederick Giasson写道:
For everybody:

Shan Wan

unread,
Jun 29, 2017, 10:57:25 AM6/29/17
to Open Semantic Framework
Hi Kitio,

This is exactly what I want. The drush and installing progress worked! Although I encounter another problem, not belonging to this topic, I will figure it out then.

Thanks a lot.

Shan

在 2017年6月29日星期四 UTC+8下午10:10:05,Kitio Fofack写道:

Frederick Giasson

unread,
Jul 1, 2017, 8:30:10 PM7/1/17
to open-semant...@googlegroups.com
Hi,

> As for the '*The program 'drush' is currently not installed. You can
> install it by typing:apt-get install drush*'
>
> I ran 'apt-get install drush', then 'drush -v', but got the same
> notice as above. don't know why.

In my experience, Drush sometimes changes the way it installs itself.
You can try installing it using another method that you can find on the
web other than using apt-get.


Thanks,

Fred

Shan Wan

unread,
Jul 2, 2017, 5:22:39 AM7/2/17
to Open Semantic Framework
Thanks Fred, 

The drush issue has been solved, and it is because I upgrade Ubuntu from 12.04 to Ubuntu14.04 and the default php version changes to be php7, and my current drush cann't run on php7 but php5.6, that's why it displays 'drush not installed' although I have installed drush and made it working before.

I then changed the default php to 5.6 by using:

sudo ln -sfn /usr/bin/php5.6  /etc/alternatives/php

then drush can be used again!

Thanks for your reply again.

And could you look at another issue that I posted in this email: https://groups.google.com/forum/#!topic/open-semantic-framework/tqMzaul6mnM, and the latest issue I am encountering is the '1st July' one. Do you have any idea on that?

Thanks again,

Shan

   


在 2017年7月2日星期日 UTC+8上午8:30:10,Frederick Giasson写道:

Frederick Giasson

unread,
Jul 3, 2017, 8:03:10 PM7/3/17
to open-semant...@googlegroups.com
Hi,

> The drush issue has been solved, and it is because I upgrade Ubuntu
> from 12.04 to Ubuntu14.04 and the default php version changes to be
> php7, and my current drush cann't run on php7 but php5.6, that's why
> it displays 'drush not installed' although I have installed drush and
> made it working before.
>
> I then changed the default php to 5.6 by using:
>
> |
> sudo ln -sfn /usr/bin/php5.6/etc/alternatives/php
> |
>
> then drush can be used again!

Good and thanks for the resolution of this issue!


>
> Thanks for your reply again.
>
> And could you look at another issue that I posted in this email:
> https://groups.google.com/forum/#!topic/open-semantic-framework/tqMzaul6mnM,
> and the latest issue I am encountering is the '1st July' one. Do you
> have any idea on that?

Apparently that the PMT [1] hasn't been installed. This is the OSF
Permissions Management Tool command line utility. This is what it is
complaining about.


[1] https://github.com/structureddynamics/OSF-Permissions-Management-Tool

Hope it helps,

Thanks,

Fred

Shan Wan

unread,
Jul 7, 2017, 5:22:17 AM7/7/17
to Open Semantic Framework
Thank you Fred!

I solved my pmt issue. it's because I didn't install the curl extension for php5.6, and that's why when I ran pmt command, it showed the PHP Fatal error .*****/init_curl().

Thanks again

Shan

在 2017年7月4日星期二 UTC+8上午8:03:10,Frederick Giasson写道:
Reply all
Reply to author
Forward
0 new messages