Thank you for your reply.

Please see my answers to your questions.


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

> Who are you logged in as when you do this?


Yes, correct. I logged in as root when I did this.

But, I must say that I did change the ownership of the package as follows:
- tar xvfz DBI-1.631
- chown –R user.user ./DBI-1.631
- chmod 755 ./DBI-1.631
- cd ./DBI-1.631
- perl Makefile.PL
- make
- make test
- make test TEST_VERBOSE=1
- make install


And when I run all the above commands, I logged in as root. hmmm... could it be 
that I shouldn't have logged in as root but instead, run "sudo some_commands" 


>> 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?

as root

>> 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?
as root

>> 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.

Yes, that's correct.


>> 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.


When I built the server from scratch back then, I had done something that I 
should not have done in the first place. I installed perl from the source as 
follows:
- tar xvzf perl-5.14.2.tar.gz
- cd perl-5.14.2
- ./Configure –des –Dprefix=/usr/local/perl
- make
- checkinstall –D make install


To be honest, I'm not sure if there are two perls installed on my systems but 
if I recalled, I might have accidentally run CPAN to install the perl again. 
very stupid move... learned my lesson the hard way.

Thank you very much in advance


On Thursday, 22 May 2014 8:51 AM, Ron Savage <r...@savage.net.au> wrote:
 


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