#各种依赖包下载地址
http://www.cpan.org/modules/by-module
#一共要安装的依赖包:Time::HiRes,Term::ReadKey,DBI,DBD::MysqL
#下载,解压缩
[bzuo@devdb7 ~]$ wget http://innotop.googlecode.com/files/innotop-1.8.0.tar.gz
[bzuo@devdb7 ~]$ tar zxvf innotop-1.8.0.tar.gz
#安装,报错
[bzuo@devdb7 innotop-1.8.0]$ perl Makefile.PL
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 1.
BEGIN Failed--compilation aborted at Makefile.PL line 1.
#下载依赖包
[bzuo@devdb7 ~]$ wget http://files.directadmin.com/services/9.0/ExtUtils-MakeMaker-6.31.tar.gz
[bzuo@devdb7 ~]$ tar zxvf ExtUtils-MakeMaker-6.31.tar.gz
#安装依赖包报错
[bzuo@devdb7 ~]$ cd ExtUtils-MakeMaker-6.31
[bzuo@devdb7 ExtUtils-MakeMaker-6.31]$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Could not open '': No such file or directory at lib/ExtUtils/MM_Unix.pm line 2697.
#yum安装依赖包
[root@devdb7 ExtUtils-MakeMaker-6.31]# yum install perl-ExtUtils-MakeMaker
[root@devdb7 ExtUtils-MakeMaker-6.31]# perl Makefile.PL
Writing Makefile for ExtUtils::MakeMaker
#安装,提示报错
[root@devdb7 innotop-1.8.0]# perl Makefile.PL
Warning: prerequisite DBD::MysqL 1 not found.
Warning: prerequisite DBI 1.13 not found.
Warning: prerequisite Term::ReadKey 2.1 not found.
Writing Makefile for innotop
#安装DBD,需要先安装DBI
[root@devdb7 bzuo]# wget http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/DBD-MysqL-4.020.tar.gz
[root@devdb7 bzuo]# tar zxvf DBD-MysqL-4.020.tar.gz
[root@devdb7 bzuo]# cd DBD-MysqL-4.020
[root@devdb7 DBD-MysqL-4.020]# perl Makefile.PL
Can't locate DBI/DBD.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 25.
#安装DBI,提示没有安装gcc,yum 安装gcc
[root@devdb7 bzuo]# wget http://www.cpan.org/modules/by-module/DBI/DBI-1.618.tar.gz
[root@devdb7 bzuo]# tar zxvf DBI-1.618.tar.gz
[root@devdb7 bzuo]# cd DBI-1.618
[root@devdb7 DBI-1.618]# perl Makefile.PL
[root@devdb7 DBI-1.618]# make
/bin/sh: gcc: command not found
make: *** [Perl.o] Error 127
[root@devdb7 DBI-1.618]# yum install gcc
[root@devdb7 DBI-1.618]# make && make install (正常了)
#在安装inotop,发现对DBI的提示没有了
#再安装DBD,正常了,
[root@devdb7 DBD-MysqL-4.020]# make
[root@devdb7 DBD-MysqL-4.020]# make install
#安装innotop只提示一个依赖包没有了
#下载TermReadKey
[root@devdb7 bruce]# wget http://www.cpan.org/modules/by-module/Term/TermReadKey-2.30.tar.gz
[root@devdb7 bruce]# tar zxvf TermReadKey-2.30.tar.gz
[root@devdb7 bruce]# cd TermReadKey-2.30
[root@devdb7 TermReadKey-2.30]# perl Makefile.PL
[root@devdb7 TermReadKey-2.30]# make && make install
#再来运行makefile.pl,就没报错了
[root@devdb7 innotop-1.8.0]# make && make install
#运行innotop 提示缺少HiRes
[root@devdb7 innotop-1.8.0]# innotop --help
Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/innotop line 1354.
BEGIN Failed--compilation aborted at /usr/local/bin/innotop line 1354.
#安装Time-HiRes
[root@devdb7 bruce]# wget http://www.cpan.org/modules/by-module/Time/Time-HiRes-1.9725.tar.gz
[root@devdb7 bruce]# tar zxvf Time-HiRes-1.9725.tar.gz
[root@devdb7 bruce]# cd Time-HiRes-1.9725
[root@devdb7 Time-HiRes-1.9725]# perl Makefile.PL
[root@devdb7 Time-HiRes-1.9725]# make && make install
#到此安装完成
[root@devdb7 Time-HiRes-1.9725]# innotop --help
Usage: innotop
--[no]color -C Use terminal coloring (default)
--config -c Config file to read
--count Number of updates before exiting
--delay -d Delay between updates in seconds
--help Show this help message
--host -h Connect to host
--[no]inc -i Measure incremental differences
--mode -m Operating mode to start in
#运行报错
[root@devdb7 Time-HiRes-1.9725]# innotop -uroot -pondemand -hlocalhost
/usr/bin/perl: symbol lookup error: /usr/local/lib64/perl5/auto/DBD/MysqL/MysqL.so: undefined symbol: MysqL_init
#解决办法
mkdir /tmp/MysqL-static
cp /usr/lib64/MysqL/*.a /tmp/MysqL-static
perl Makefile.PL --libs="-L/tmp/MysqL-static -lMysqLclient"
make
make test
make install
rm -rf /tmp/MysqL-static
原文链接:https://www.f2er.com/centos/380434.html