Hi

See below.

On 21/05/14 00:40, Daminto Lie wrote:
Hi,

I've been getting the following errors after installing DBI and DBD-mysql 
manually from source.

Can't locate DBI.pm in @INC (@INC contains:
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl .)

So this particular Perl does not look in /root/perl5/ as you report below.

Who are you logged in as when you do this?

This was how I installed the DBI-1.631.

- perl Makefile.PL
- make
- make test
- make test TEST_VERBOSE=1
- make install

Who are you logged in as when you do this?

And this was how I installed DBD-mysql-4.027

- perl Makefile.PL = --mysql_config=/home/mysql/bin/mysql_config 
--testuser=root --testpassword=myPasswd
- make -j3
- make test
- checkinstall -D make install

Who are you logged in as when you do this?

I also noticed that during the completion of the installation of DBI, it 
actually installed it in the /root directory as follows:

Installing 
/root/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/auto/DBI/Driver_xst.h
[snip]

Perhaps you were logged on as root when you installed this version of Perl and DBI.

And Furthermore, I might have accidentally installed Perl twice - one manually 
from the source and the other from the Repo.

Thus, now, my DBI.pm is located in the following location:
/root/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/DBI.pm
/root/perl5/lib/perl5/i686-linux-gnu-thread-multi-64int/Bundle/DBI.pm

That's normal. The problem lies elsewhere.

This has affected the operation of my spamassassin, amavis and sqlgrey. All of 
them throw up a similar error

For spamassassin, the error is Can't locate DBI.pm in @INC (@INC contains: lib 
/usr/local/share/perl/5.14.2 /etc/perl /usr/local/lib/perl/5.14.2 
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 
/usr/local/lib/site_perl) at 
/usr/local/share/perl/5.14.2/Mail/SpamAssassin/SQLBasedAddrList.pm line 82.

This suggests spamassassin (and amavis etc below) are not logged on as root when they run. That is, they are using a different Perl than the one installed as root.

For amavis, the error is Can't locate DBI.pm in @INC (@INC contains: lib 
/etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 
/usr/local/lib/site_perl) at 
/usr/local/share/perl/5.14.2/Mail/SpamAssassin/BayesStore/SQL.pm line 50.

Can't locate DBI.pm in @INC (@INC contains: lib /etc/perl 
/usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 
/usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 
/usr/local/lib/site_perl) at 
/usr/local/share/perl/5.14.2/Mail/SpamAssassin/BayesStore/MySQL.pm line 51.

For sqlgrey, it is Can't locate DBI.pm in @INC (@INC contains: /etc/perl 
/usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 
/usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 
/usr/local/lib/site_perl .) at /usr/sbin/sqlgrey line 34.
BEGIN failed--compilation aborted at /usr/sbin/sqlgrey line 34.

I was wondering if there is any way of pointing it to the right location of DBI 
and DBD-mysql so that it would be able to load the DBI.pm (without having to 
rebuild my system from scratch)

Each version of Perl installed knows if and where DBI is installed.

How many versions of Perl do you have installed?

Which version is being used by each of the programs you've having trouble with?

--
Ron Savage
savage.net.au

Reply via email to