Page 1 of 1

/usr/bin/convert: No such file or directory error - FIXED!

Posted: 2010-02-18T10:22:14-07:00
by CGRemakes
I decided I would go ahead and ugrade my ImageMagick today. I did it first on an old backup of our web server to make sure it would do so without problems. No problems, worked flawlessly. So, I decided to do it on my actual web server. However, after installing, I now get an error "-bash: /usr/bin/convert: No such file or directory". What is causing it to try to look in /usr/bin for convert, instead of /usr/local/bin? Yes, copying the file to /usr/bin does "fix" the problem, but why is it behaving differently on a server that is virtually identical? Doing "which convert" returns "/usr/local/bin/convert". I'm a little less experienced with Linux than Windows, so I'm not sure how to change that. Thanks!

EDIT:

Not really super important, but doing a "which -a convert" returns both versions of the file (I did a copy, not a move). However, I would still prefer it looked in /usr/local/bin, not /usr/bin for the file (just for consistency reasons, if nothing else).

Another interesting thing, is it locates "mogrify" just fine, which is also stored in "/usr/local/bin". Strange! Also, "/usr/local/bin" is in my $PATH variable.

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T11:01:38-07:00
by fmw42
Perhaps you had multiple versions of IM on your server. You might consider removing all versions of IM and then reinstalling the latest version.

I am not a unix expert, so perhaps one of the IM experts can clarify further.

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T11:07:15-07:00
by CGRemakes
fmw42 wrote:Perhaps you had multiple versions of IM on your server. You might consider removing all versions of IM and then reinstalling the latest version.

I am not a unix expert, so perhaps one of the IM experts can clarify further.
Yeah, that was part of the upgrade. I completely uninstalled IM, then reinstalled the new version.

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T11:14:48-07:00
by fmw42
Did you install from binary or source? If from source was it manually or with some tool or RPM. Perhaps the tool or RPM put it wrongly in /usr/bin. If you install from binary or manually from source, it should go to the right location, /usr/local/bin.

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T11:25:50-07:00
by CGRemakes
fmw42 wrote:Did you install from binary or source? If from source was it manually or with some tool or RPM. Perhaps the tool or RPM put it wrongly in /usr/bin. If you install from binary or manually from source, it should go to the right location, /usr/local/bin.
I did it from the source. I followed these steps (with the exception of the parts that apply to RoR):

https://support.railsmachine.com/index. ... age&id=133

As I mentioned, I did it also on a previous backup of the same server. It was from a few weeks ago, but nothing other than PHP/MySQL files should be different. I haven't changed any configurations.

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T13:05:42-07:00
by fmw42

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T15:34:54-07:00
by snibgo
If I understand you correctly:

1. Executing "$ convert" runs /usr/bin/convert.

2. "which convert" shows /usr/local/bin/convert.

If that's true, something is badly wrong (with your Unix, not Imagemagick).

Re: -bash: /usr/bin/convert: No such file or directory error

Posted: 2010-02-18T16:55:02-07:00
by CGRemakes
snibgo wrote:If I understand you correctly:

1. Executing "$ convert" runs /usr/bin/convert.

2. "which convert" shows /usr/local/bin/convert.

If that's true, something is badly wrong (with your Unix, not Imagemagick).
It lists both /usr/local/bin/convert, as well as /usr/local/convert using the -a switch for which. Both files do legitimately exist. Why it defaults to look in /usr/bin, and ignores /usr/local/bin when running convert, I don't know. What is it that tells Unix/Linux to look here (other than the PATH). Both are in the path, so I'm not sure what's up.

EDIT:

Nevermind, after rebooting, it's a happy camper. Should have tried it earlier, but oh well. :D

Re: /usr/bin/convert: No such file or directory error - FIXE

Posted: 2014-10-30T01:57:43-07:00
by ghindows
In shell scripts, when using full path for convert /usr/local/bin/convert replace with `which -a convert | head -n1` this get first location for this.
For example :

Code: Select all

/usr/local/bin/convert $filename  -resize 340x255 -background black  -gravity center -extent 340x255  -format jpg -quality 85 $filename2
replace with :

Code: Select all

`which -a convert | head -n1` $filename  -resize 340x255 -background black  -gravity center -extent 340x255  -format jpg -quality 85 $filename2