bash: /usr/bin/autoreconf: /usr/bin/perl: bad interpreter: No such file or directory - perl

I am trying to compile some software in Windows using MSYS2 mingw64.exe terminal.
On running the autoreconf -i command, I get the error:
-bash: /usr/bin/autoreconf: /usr/bin/perl: bad interpreter: No such file or directory
ls /usr/bin/ doesn't show perl.exe
I remember that perl was installed using some pacman -S command.
As far as I remember, this issue has come up since this month.
(I had reinstalled MSYS2 and Pacman packages thrice this month & the issue does not seem to go. Last time, I had installed all these in May this year & there were no such issues then)
I even re-installed perl in Msys2 and the following output is displayed:
$ pacman -S perl
warning: perl-5.30.3-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) perl-5.30.3-1
Total Installed Size: 50.67 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring [####################################################################] 100%
(1/1) checking package integrity [####################################################################] 100%
(1/1) loading package files [####################################################################] 100%
(1/1) checking for file conflicts [####################################################################] 100%
(1/1) checking available disk space [####################################################################] 100%
warning: could not get file information for usr/bin/perl.exe
warning: could not get file information for usr/bin/perl5.30.3.exe
:: Processing package changes...
(1/1) reinstalling perl [####################################################################] 100%
warning: warning given when extracting /usr/bin/perl.exe (Can't create '/usr/bin/perl.exe')
warning: warning given when extracting /usr/bin/perl5.30.3.exe (Hard-link target 'usr/bin/perl.exe' does not exist.)
Still, the same issue -bash: /usr/bin/autoreconf: /usr/bin/perl: bad interpreter: No such file or directory appears
I also tried installing older version(5.28) of perl by:
pacman -S mingw-w64-i686-perl mingw-w64-x86_64-perl
Still the same issue
On further observation, I found out that the perl was getting installed in /mingw64/bin directory instead of /usr/bin.
I tried adding /mingw64/bin directory to the PATH variable as follows:
export PATH="$PATH:/mingw64/bin"
However, the issue is still the same
Please help

Related

How to install dmake with perl?

Can someone please tell me how to download dmake with Perl?
I have tried with CPAN, but this is what I get:
cpan> install dmake
Database was generated on Wed, 10 Jul 2019 10:13:05 GMT
Running install for module 'dmake'
'" "' is not recognized as an internal or external command,
operable program or batch file.
Checksum for C:\STRAWB~1\cpan\sources\authors\id\S\SH\SHAY\dmake-4.12.2.2.zip ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
............................................................................DONE
Package contains both files[ChangeLog COPYING dmake.exe META.yml NEWS PATCH.TXT README.TXT] and directories[man readme startup]; not recognized as a perl package, giving up
Configuring S/SH/SHAY/dmake-4.12.2.2.zip with Makefile.PL
Running make for S/SH/SHAY/dmake-4.12.2.2.zip
gmake: *** No targets specified and no makefile found. Stop.
SHAY/dmake-4.12.2.2.zip
C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'dmake'.
Failed during this command:
SHAY/dmake-4.12.2.2.zip : writemakefile NO -- Package contains both files[ChangeLog COPYING dmake.exe META.yml NEWS PATCH.TXT README.TXT] and directories[man readme startup]; not recognized as a perl package, giving up
I have also tried with ppm install dmake, but I got this:
Installing package 'dmake'...
Error installing package 'dmake': Could not locate a PPD file for package dmake
Not answering the question because it's a XY problem, but giving you the info you need.
The most recent mod_perl2 compiled for Strawberry is against Perl 5.12, which is long out of support. Using any other version of Perl is not going to work. You should ask ApTest to update and recompile for a current Strawberry and release a new setup_spmp helper. They are relying on a dead piece of tech (mod_perl2), so they should either support the required dependency properly or move their application onto a modern stack.

Debian aptitude install: 'find' not found in PATH or not executable

When I try to install any package such as php5, it gives me this error.
I did update and upgrade all libraries.
root#host:~# apt-get install apache2-mpm-prefork libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-mpm-prefork is already the newest version.
The following extra packages will be installed:
libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6,106 kB of archives.
After this operation, 18.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
debconf: delaying package configuration, since apt-utils is not installed
dpkg: warning: 'find' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Can someone help me?
There is probably something messed up with the permissions of find, find on your installation is probably located in /usr/bin/find, to check the permissions of this application run
ls -l /usr/bin/find
This should return something like this:
-rwxr-xr-x 1 root root 136152 Oct 26 2010 /usr/bin/find
If this returns an error, try to ls find on other locations in you path (eg. /bin/find, /usr/local/sbin/find)
The first part should be identical for the command to work. If not, reset the permissions to with the following command:
chmod 755 /usr/bin/find
This should fix it.

pip -r not working as expected in virtualenv

I have a really strange issue with the behavior of pip in a virtualenv.
I have set
export PIP_REQUIRE_VIRTUALENV=true
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
export VIRTUALENV_DISTRIBUTE=true
Now, when I'm in my virtualenv and want to install my dependencies:
pip install -r requirements/_base.txt
(for testing purposes, requirements/_base.txt only contains:)
Django==1.5
Anyway, when I try to install it, I only get:
Downloading/unpacking Django==1.5 (from -r requirements/_base.txt (line 1))
Running setup.py egg_info for package Django
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
And after that, Django is not installed.
Here comes the strange part: When I install Django manually with
pip install Django==1.5
it's working perfectly (though the same two warnings appear):
Downloading/unpacking Django==1.5
Running setup.py egg_info for package Django
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
Installing collected packages: Django
Running setup.py install for Django
changing mode of build/scripts-2.7/django-admin.py from 644 to 755
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
changing mode of /usr/local/share/python/django-admin.py to 755
Successfully installed Django
Cleaning up...
I faced a similar problem and realized that removing the version requirement solved the problem. Don't know why though...
I figured out why this was happening to me, which may also solve the problem for others who see this page. For me, the problem was that I had a requirement that can not install automatically via pip. The pip freeze exported the package name and version but, for whatever reason, pip cannot install that package directly in a requirements install. I have to instead install it manually from a zip file.
The problem you might be experiencing, then, is that you have a requirement which cannot be installed by pip's requirements installer. Check your output log for red text, errors, that sort of thing.
I figured this out using this post:
pip fails to install packages from requirements.txt

Desperately in need of help compiling Font::FreeType CPAN module with Strawberry Perl

For literally days now, I have been scouring the web, and cursing and tearing my hair out, trying to compile Font::FreeType with dmake for dwimperl-5.14.2.1-v7-32bit (Strawberry Perl 5.14.2.1). For openers, there are several bugs in the FreeType.xs file for which I found a patch at Bug #32713 for Font-FreeType: patch for Font-FreeType-0.03. Lovely. The last update for this module is 11 Sep 2004 (note the day) so it is dead for sure, but I need it for using REAL fonts with perlcairo. So I am determined (desperate) to get it working. So far I have had no problems using cpan with the exception of this module. In fact Strawberry Perl is the only Windows perl I have used that actually works right out of the box with CPAN. This is obviously a rogue module. Even *nix users have had problems with it.
I read How do I fix Perl's Font::FreeType compilation errors? but no help there so I think a new thread is justified.
Number found where operator expected at Makefile.PL line 17, near "my $font_filename = catfile($data_dir, '5"
(Might be a runaway multi-line '' string starting on line 9)
(Do you need to predeclare my?)
Makefile.pl:
1 use ExtUtils::MakeMaker;
2 use File::Spec::Functions;
3
4 WriteMakefile(
5 NAME => 'Font::FreeType',
6 AUTHOR => 'Geoff Richards <qef#laxan.com>',
7 VERSION_FROM => 'lib/Font/FreeType.pm',
8 LIBS => [ '-lfreetype' ],
9 INC => '-I/usr/include/freetype2',
10 NO_META => 1,
11 );
12
13
14 # Generate a listing of the characters in the BDF test font, for checking
15 # that the library can find them all. See t/10metrics_5x7bdf.t
16 my $data_dir = catdir(qw( t data ));
17 my $font_filename = catfile($data_dir, '5x7.bdf');
This runs just fine using perl so what is dmake's problem? If I just run it with perl, dmake will re-run it. I can't figure out how to get dmake to just use what's there and I find no REAL documenation on dmake, just the useless help and man page (at least useless to me).
I tried adding a trailing slash to $data_dir but same error. Finally I just set $font_filename to the complete path. Crude, I know, but it works.
So this now creates FreeType.c but now there are path problems:
gcc -c -I/usr/include/freetype2 -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" "-IC:\Dwimperl\perl\lib\CORE" FreeType.c
FreeType.xs:19:22: fatal error: ft2build.h: No such file or directory
FreeType.c contains:
#include <ft2build.h>
#include FT_FREETYPE_H
I tried changing include paths in Makefile.pl but I really don't know the "proper" way to do that:
WriteMakefile(
.
LIBS => '-LC:/gtk/lib -lfreetype',
INC => '-IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/Dwimperl/c/include',
I think now the problem is converting *nix paths to Windows ones so the compiler can find all the header files. Has anyone successfully compiled this damned module in Windows using ANY compiler? Or does anyone at least know how to specify the Windows paths for WriteMakefile?
I was also trying to get the latest FreeType module to install on cygwin using cpan like so:
$ cpan
cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.
cpan[1]> install Font::FreeType
The first issue I ran into was during the make phase. Make was complaining about not being able to find ft2build.h.
It's then that I realized I had to download and compile/install the FreeType library first (doh!). So, I downloaded the latest from the FreeType download page, and installed it like so:
$ cd cygwin/freetype-2.4.0
$ ./configure
...
$ make
...
$ make install
The next issue is that when I tried to make the module in cpan again, it was failing at the following line in ft2build.h:
#include <freetype/config/ftheader.h>
If you take a look at the actual file (in /usr/local/include/ft2build.h on my system, but it may be somewhere else on yours) you will see this comment before that line:
/* `<prefix>/include/freetype2' must be in your current inclusion path */
So, I set the appropriate environment variable (The "proper" way, I believe -- better than modifying the "INC" line in the make file):
$ C_INCLUDE_PATH=/usr/local/include/freetype2
$ export C_INCLUDE_PATH
After fixing that, the next problem I ran into is the lvalue error:
$ cpan install Font::FreeType
CPAN: Storable loaded ok (v2.27)
...
FreeType.xs:808:21: error: lvalue required as left operand of assignment
...
Makefile:340: recipe for target `FreeType.o' failed
make: *** [FreeType.o] Error 1
GEOFFR/Font-FreeType-0.03.tar.gz
/usr/bin/make -- NOT OK
CPAN: YAML loaded ok (v0.84)
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
I know you've already fixed that, but I'll post the info here in case someone else runs into it. Save the patch file from here to FreeType.xs.diff (Your Font-FreeType-0.03 directory may be named differently), apply it, and make/compile like below. Note that since we modified the module we can't use cpan anymore, thus we make it manually:
$ cd ~/.cpan/build/Font-FreeType-0.03
$ patch FreeType.xs FreeType.xs.diff
patching file FreeType.xs
$ make
Makefile out-of-date with respect to Makefile.PL
...
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command. <==
false
Makefile:866: recipe for target `Makefile' failed
make: *** [Makefile] Error 1
$ make
cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm
...
Manifying blib/man3/Font.FreeType.3pm
$ make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
...
Appending installation info to /usr/lib/perl5/5.14/i686-cygwin-threads-64int/perllocal.pod
Voila! It's compiled! Another thing to point out is that I used regular gnu make rather than dmake, as Borodin pointed out earlier. The FreeType install notes say you have to run GNU Make 3.80 or later. You can check what version of make you have installed like this:
$ make -v
GNU Make 3.82.90
Built for i686-pc-cygwin
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

How to install XML::Parser without expat-devel?

XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser, cpan fails with lots of errors about Expat.c and Expat.xs:
[...]
Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’
Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’:
Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function)
Expat.c:2904: error: expected ‘;’ before ‘parser’
Expat.xs:2194: error: ‘parser’ undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpan/build/XML-Parser-2.41-rpV6ok/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Message at the start of the output explains that expat-devel is needed for building.
Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. Install 'expat-devel' package with your
OS package manager. See 'README'.
But expat-devel is not in Debian repository.
Is it possible to get over this without need to build/install expat from source?
The package you want to install is named libexpat1-dev. You could also just install libxml-parser-perl via apt-get. Or if you really want to install via CPAN try installing the Debian packages dependencies first via apt-get build-dep libxml-parser-perl.
libexpat1-dev contains both libexpat and expat.h, which are both mentioned in the message as well:
If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:
EXPATLIBPATH=... To set the directory in which to find libexpat
EXPATINCPATH=... To set the directory in which to find expat.h
Installing libexpat1-dev seems to solve the problem:
$ aptitude install libexpat1-dev
There is always the manual method - to build/install expat from source.
(This example shows installing to an alternative location for XAMPP | LAMPP)
Download from:
http://sourceforge.net/projects/expat/files/expat/
tar zxf /[where-ever]/expat-2.1.0.tar.gz -C /tmp
cd /tmp/expat-2.1.0
/opt/lampp/bin/perl ./configure --prefix=/opt/lampp LDFLAGS=-L/opt/lampp/lib
make
make install
http://search.cpan.org - search for and download - XML::Parser
tar zxf /[where-ever]/XML-Parser-2.41.tar.gz -C /tmp
cd /tmp/XML-Parser-2.41
/opt/lampp/bin/perl ./Makefile.PL EXPATLIBPATH=/opt/lampp/lib EXPATINCPATH=/opt/lampp/include
make
make test
make install
Work like a charm in Ubuntu 15.04. The only thing that I need is install Perl XML Parser with:
sudo apt-get install libxml-parser-perl
And following the instructions here, I was able to import successfully all my ratings into Rhythmbox. Now, the only work that I need to do is create again the smart play lists, that is nothing compared with my entire libray ratings.
Today I had the same issue wanting to complile the new GIMP 2.9.4 beta on OSX 10.8 and the aid of homebrew.
First install perl
brew install perl
Then the XML::Parser module by going into the perl shell with
perl -MCPAN -e shell
And inside the shell install XML::Parser by typing
install XML::Parser
Exit shell
exit
Now, verify it has been installed successfully. If everything is ok, you will not see an error.
perl -e "require XML::Parser"
If the ./configure still fails missing XML::Parser, then intltools is not using the perl you have installed. Looking at the script tells me it does the test with $INTLTOOL_PERL -e "require XML::Parser". Trying a echo $INTLTOOL_PERL gave out nothing, so the magic is to set it with
export $INTLTOOL_PERL=perl
Now run ./configure again.
None of the above methods worked for me. I had the right environment variables setup but they were somehow not picked up by cpanm that I use to install perl modules. Expat was also installed.
Here is what I did to overcome the same problem that OP is reporting.
This is very close to what #LadyBuzz suggested.
Download the XML::Parser from cpan.org
Extract the tarball into directory and descend to it.
Open the Makefile.pl and edit the first lines to actually have the absolute paths to both: EXPATLIBPATH and EXPATINCPATH
Save the Makefile.pl, go up one level and create a new tarball with the Makefile.pl that you just edited.
Execute cpanm on the newly created tarball.
This resulted in successful installation of the module.