pgintro.net

cpanminus

作成日時:2019/04/10

更新日時:2019/04/10

スポンサーリンク

この記事の確認環境

OS

$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

perlbrew

$ cpanm --version
cpanm (App::cpanminus) version 1.7044 (/home/user/bin/cpanm)
perl version 5.016003 (/usr/bin/perl)

ドキュメント

CGIスクリプトで「LWP::Simple」が必要だったのでcpanmにてインストール

$ cpanm LWP::Simple
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on LWP::Simple
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.38.tar.gz ... OK
==> Found dependencies: Module::Metadata, CPAN::Meta::Requirements, ExtUtils::MakeMaker
--> Working on Module::Metadata
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Module-Metadata-1.000033.tar.gz ... OK
==> Found dependencies: ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.34.tar.gz ... OK
Configuring ExtUtils-MakeMaker-7.34 ... Can't locate ExtUtils/Manifest.pm in @INC (@INC contains: FatPacked::27589512=HASH(0x1a4fb88) /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 /home/adm/bin/cpanm line 132.
OK

上記でエラーが出たので「perl-ExtUtils-Manifest」をyumにてインストール

# yum install -y perl-ExtUtils-Manifest

「perl-ExtUtils-Manifest」インストール後に再度cpanmにて「LWP::Simple」のインストールを実行

!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on LWP::Simple
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.38.tar.gz ... OK
==> Found dependencies: Module::Metadata, CPAN::Meta::Requirements, ExtUtils::MakeMaker
--> Working on Module::Metadata
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Module-Metadata-1.000033.tar.gz ... OK
==> Found dependencies: ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.34.tar.gz ... OK
Configuring ExtUtils-MakeMaker-7.34 ... OK
Building and testing ExtUtils-MakeMaker-7.34 ... ! Installing ExtUtils::MakeMaker failed. See /home/adm/.cpanm/work/1554910347.4244/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'ExtUtils::MakeMaker' is not installed
! Bailing out the installation for Module-Metadata-1.000033.
FAIL
--> Working on CPAN::Meta::Requirements
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/CPAN-Meta-Requirements-2.140.tar.gz ... OK
! Installing the dependencies failed: Module 'ExtUtils::MakeMaker' is not installed
! Bailing out the installation for CPAN-Meta-Requirements-2.140.
! Installing the dependencies failed: Module 'Module::Metadata' is not installed, Module 'CPAN::Meta::Requirements' is not installed, Module 'ExtUtils::MakeMaker' is not installed
! Bailing out the installation for libwww-perl-6.38.
==> Found dependencies: ExtUtils::MakeMaker

「perl-libwww-perl」インストール

上記でまだエラーが出ていて、エラー情報調べていく中で必要との情報があったのでインストール。

# yum -y install perl-libwww-perl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.tsukuba.wide.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package perl-libwww-perl.noarch 0:6.05-2.el7 will be installed
--> Processing Dependency: perl(WWW::RobotRules) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI) >= 1.10 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(Net::HTTP) >= 6.04 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(LWP::MediaTypes) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Status) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Response) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Request::Common) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Request) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Negotiate) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Date) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Daemon) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Cookies) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(File::Listing) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI::Heuristic) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI::Escape) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTML::HeadParser) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTML::Entities) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(Encode::Locale) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Running transaction check
---> Package perl-Encode-Locale.noarch 0:1.03-5.el7 will be installed
---> Package perl-File-Listing.noarch 0:6.04-7.el7 will be installed
---> Package perl-HTML-Parser.x86_64 0:3.71-4.el7 will be installed
--> Processing Dependency: perl(HTML::Tagset) >= 3 for package: perl-HTML-Parser-3.71-4.el7.x86_64
---> Package perl-HTTP-Cookies.noarch 0:6.01-5.el7 will be installed
---> Package perl-HTTP-Daemon.noarch 0:6.01-8.el7 will be installed
--> Processing Dependency: perl(IO::Socket::IP) for package: perl-HTTP-Daemon-6.01-8.el7.noarch
---> Package perl-HTTP-Date.noarch 0:6.02-8.el7 will be installed
--> Processing Dependency: perl(Time::Zone) for package: perl-HTTP-Date-6.02-8.el7.noarch
---> Package perl-HTTP-Message.noarch 0:6.06-6.el7 will be installed
--> Processing Dependency: perl(IO::HTML) for package: perl-HTTP-Message-6.06-6.el7.noarch
---> Package perl-HTTP-Negotiate.noarch 0:6.01-5.el7 will be installed
---> Package perl-LWP-MediaTypes.noarch 0:6.02-2.el7 will be installed
---> Package perl-Net-HTTP.noarch 0:6.06-2.el7 will be installed
--> Processing Dependency: perl(IO::Socket::SSL) >= 1.38 for package: perl-Net-HTTP-6.06-2.el7.noarch
---> Package perl-URI.noarch 0:1.60-9.el7 will be installed
--> Processing Dependency: perl(Business::ISBN) for package: perl-URI-1.60-9.el7.noarch
---> Package perl-WWW-RobotRules.noarch 0:6.02-5.el7 will be installed
--> Running transaction check
---> Package perl-Business-ISBN.noarch 0:2.06-2.el7 will be installed
--> Processing Dependency: perl(Business::ISBN::Data) >= 20120719.001 for package: perl-Business-ISBN-2.06-2.el7.noarch
---> Package perl-HTML-Tagset.noarch 0:3.20-15.el7 will be installed
---> Package perl-IO-HTML.noarch 0:1.00-2.el7 will be installed
---> Package perl-IO-Socket-IP.noarch 0:0.21-5.el7 will be installed
---> Package perl-IO-Socket-SSL.noarch 0:1.94-7.el7 will be installed
--> Processing Dependency: perl-Net-SSLeay >= 1.55-5 for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::SSLeay) >= 1.21 for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::SSLeay) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::LibIDN) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Mozilla::CA) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
---> Package perl-TimeDate.noarch 1:2.30-2.el7 will be installed
--> Running transaction check
---> Package perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7 will be installed
---> Package perl-Mozilla-CA.noarch 0:20130114-5.el7 will be installed
---> Package perl-Net-LibIDN.x86_64 0:0.12-15.el7 will be installed
---> Package perl-Net-SSLeay.x86_64 0:1.55-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch     Version          Repository
                                       Size
================================================================================
Installing:
 perl-libwww-perl      noarch   6.05-2.el7         base   205 k
Installing for dependencies:
 perl-Business-ISBN      noarch   2.06-2.el7         base    25 k
 perl-Business-ISBN-Data   noarch   20120719.001-2.el7     base    24 k
 perl-Encode-Locale      noarch   1.03-5.el7         base    16 k
 perl-File-Listing       noarch   6.04-7.el7         base    13 k
 perl-HTML-Parser      x86_64   3.71-4.el7         base   115 k
 perl-HTML-Tagset      noarch   3.20-15.el7        base    18 k
 perl-HTTP-Cookies       noarch   6.01-5.el7         base    26 k
 perl-HTTP-Daemon      noarch   6.01-8.el7         base    21 k
 perl-HTTP-Date        noarch   6.02-8.el7         base    14 k
 perl-HTTP-Message       noarch   6.06-6.el7         base    82 k
 perl-HTTP-Negotiate     noarch   6.01-5.el7         base    17 k
 perl-IO-HTML        noarch   1.00-2.el7         base    23 k
 perl-IO-Socket-IP       noarch   0.21-5.el7         base    36 k
 perl-IO-Socket-SSL      noarch   1.94-7.el7         base   115 k
 perl-LWP-MediaTypes     noarch   6.02-2.el7         base    24 k
 perl-Mozilla-CA       noarch   20130114-5.el7       base    11 k
 perl-Net-HTTP         noarch   6.06-2.el7         base    29 k
 perl-Net-LibIDN       x86_64   0.12-15.el7        base    28 k
 perl-Net-SSLeay       x86_64   1.55-6.el7         base   285 k
 perl-TimeDate         noarch   1:2.30-2.el7       base    52 k
 perl-URI          noarch   1.60-9.el7         base   106 k
 perl-WWW-RobotRules     noarch   6.02-5.el7         base    18 k

Transaction Summary
================================================================================
Install  1 Package (+22 Dependent packages)

Total download size: 1.3 M
Installed size: 3.0 M
Downloading packages:
--------------------------------------------------------------------------------
Total                        1.0 MB/s | 1.3 MB  00:01   
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-LWP-MediaTypes-6.02-2.el7.noarch             1/23 
  Installing : perl-IO-Socket-IP-0.21-5.el7.noarch             2/23 
  Installing : perl-Encode-Locale-1.03-5.el7.noarch            3/23 
  Installing : perl-HTML-Tagset-3.20-15.el7.noarch             4/23 
  Installing : perl-Net-LibIDN-0.12-15.el7.x86_64              5/23 
  Installing : 1:perl-TimeDate-2.30-2.el7.noarch               6/23 
  Installing : perl-HTTP-Date-6.02-8.el7.noarch              7/23 
  Installing : perl-File-Listing-6.04-7.el7.noarch             8/23 
  Installing : perl-Net-SSLeay-1.55-6.el7.x86_64               9/23 
  Installing : perl-Business-ISBN-Data-20120719.001-2.el7.noarch      10/23 
  Installing : perl-Business-ISBN-2.06-2.el7.noarch             11/23 
  Installing : perl-URI-1.60-9.el7.noarch                 12/23 
  Installing : perl-WWW-RobotRules-6.02-5.el7.noarch            13/23 
  Installing : perl-Mozilla-CA-20130114-5.el7.noarch            14/23 
  Installing : perl-IO-Socket-SSL-1.94-7.el7.noarch             15/23 
  Installing : perl-Net-HTTP-6.06-2.el7.noarch              16/23 
  Installing : perl-IO-HTML-1.00-2.el7.noarch               17/23 
  Installing : perl-HTTP-Message-6.06-6.el7.noarch            18/23 
  Installing : perl-HTTP-Cookies-6.01-5.el7.noarch            19/23 
  Installing : perl-HTML-Parser-3.71-4.el7.x86_64             20/23 
  Installing : perl-HTTP-Negotiate-6.01-5.el7.noarch            21/23 
  Installing : perl-HTTP-Daemon-6.01-8.el7.noarch             22/23 
  Installing : perl-libwww-perl-6.05-2.el7.noarch             23/23 
  Verifying  : perl-Business-ISBN-2.06-2.el7.noarch            1/23 
  Verifying  : perl-HTTP-Cookies-6.01-5.el7.noarch             2/23 
  Verifying  : perl-IO-HTML-1.00-2.el7.noarch                3/23 
  Verifying  : perl-HTML-Parser-3.71-4.el7.x86_64              4/23 
  Verifying  : perl-LWP-MediaTypes-6.02-2.el7.noarch             5/23 
  Verifying  : perl-HTTP-Message-6.06-6.el7.noarch             6/23 
  Verifying  : perl-HTTP-Date-6.02-8.el7.noarch              7/23 
  Verifying  : perl-WWW-RobotRules-6.02-5.el7.noarch             8/23 
  Verifying  : perl-Encode-Locale-1.03-5.el7.noarch            9/23 
  Verifying  : perl-IO-Socket-SSL-1.94-7.el7.noarch             10/23 
  Verifying  : perl-Mozilla-CA-20130114-5.el7.noarch            11/23 
  Verifying  : perl-Business-ISBN-Data-20120719.001-2.el7.noarch      12/23 
  Verifying  : perl-IO-Socket-IP-0.21-5.el7.noarch            13/23 
  Verifying  : perl-Net-SSLeay-1.55-6.el7.x86_64              14/23 
  Verifying  : perl-HTTP-Negotiate-6.01-5.el7.noarch            15/23 
  Verifying  : perl-libwww-perl-6.05-2.el7.noarch             16/23 
  Verifying  : perl-HTTP-Daemon-6.01-8.el7.noarch             17/23 
  Verifying  : perl-Net-HTTP-6.06-2.el7.noarch              18/23 
  Verifying  : 1:perl-TimeDate-2.30-2.el7.noarch              19/23 
  Verifying  : perl-Net-LibIDN-0.12-15.el7.x86_64             20/23 
  Verifying  : perl-HTML-Tagset-3.20-15.el7.noarch            21/23 
  Verifying  : perl-URI-1.60-9.el7.noarch                 22/23 
  Verifying  : perl-File-Listing-6.04-7.el7.noarch            23/23 

Installed:
  perl-libwww-perl.noarch 0:6.05-2.el7                      

Dependency Installed:
  perl-Business-ISBN.noarch 0:2.06-2.el7                    
  perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7               
  perl-Encode-Locale.noarch 0:1.03-5.el7                    
  perl-File-Listing.noarch 0:6.04-7.el7                     
  perl-HTML-Parser.x86_64 0:3.71-4.el7                      
  perl-HTML-Tagset.noarch 0:3.20-15.el7                     
  perl-HTTP-Cookies.noarch 0:6.01-5.el7                     
  perl-HTTP-Daemon.noarch 0:6.01-8.el7                      
  perl-HTTP-Date.noarch 0:6.02-8.el7                      
  perl-HTTP-Message.noarch 0:6.06-6.el7                     
  perl-HTTP-Negotiate.noarch 0:6.01-5.el7                     
  perl-IO-HTML.noarch 0:1.00-2.el7                        
  perl-IO-Socket-IP.noarch 0:0.21-5.el7                     
  perl-IO-Socket-SSL.noarch 0:1.94-7.el7                    
  perl-LWP-MediaTypes.noarch 0:6.02-2.el7                     
  perl-Mozilla-CA.noarch 0:20130114-5.el7                     
  perl-Net-HTTP.noarch 0:6.06-2.el7                       
  perl-Net-LibIDN.x86_64 0:0.12-15.el7                      
  perl-Net-SSLeay.x86_64 0:1.55-6.el7                       
  perl-TimeDate.noarch 1:2.30-2.el7                       
  perl-URI.noarch 0:1.60-9.el7                          
  perl-WWW-RobotRules.noarch 0:6.02-5.el7                     

Complete!
cpanm ExtUtils::MakeMaker 2>&1 | tee cpanm_install_ExtUtils__MakeMaker.txt
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /home/adm/.cpanm/work/1554912566.4667
You have make /bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 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.

Written by John Gilmore and Jay Fenlason.
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
Searching ExtUtils::MakeMaker () on cpanmetadb ...
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.34.tar.gz
-> OK
Unpacking ExtUtils-MakeMaker-7.34.tar.gz
Entering ExtUtils-MakeMaker-7.34
Checking configure dependencies from META.json
Configuring ExtUtils-MakeMaker-7.34
Running Makefile.PL
Using included version of CPAN::Meta (2.143240) because it is not already installed.
Using included version of Parse::CPAN::Meta (1.4414) because it is not already installed.
Using included version of CPAN::Meta::YAML (0.011) because it is not already installed.
Using included version of ExtUtils::Manifest (1.70) as it is newer than the installed version (1.61).
Using included version of JSON::PP (2.27203) because it is not already installed.
Using included version of ExtUtils::Install (2.06) because it is not already installed.
Using included version of CPAN::Meta::Requirements (2.131) because it is not already installed.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Data::Dumper 0 ... Yes (2.145)
Checking if you have File::Spec 0.8 ... Yes (3.40)
Checking if you have Pod::Man 0 ... Yes (2.27)
Checking if you have File::Basename 0 ... Yes (2.84)
Checking if you have Encode 0 ... Yes (2.51)
Building and testing ExtUtils-MakeMaker-7.34
cp inc/ExtUtils/Manifest.pm blib/lib/ExtUtils/Manifest.pm
cp lib/ExtUtils/MM_VOS.pm blib/lib/ExtUtils/MM_VOS.pm
cp lib/ExtUtils/MM.pm blib/lib/ExtUtils/MM.pm
cp inc/JSON/PP.pm blib/lib/JSON/PP.pm
cp lib/ExtUtils/MM_UWIN.pm blib/lib/ExtUtils/MM_UWIN.pm
cp lib/ExtUtils/MM_DOS.pm blib/lib/ExtUtils/MM_DOS.pm
cp lib/ExtUtils/MM_Cygwin.pm blib/lib/ExtUtils/MM_Cygwin.pm
cp lib/ExtUtils/MM_Win95.pm blib/lib/ExtUtils/MM_Win95.pm
cp lib/ExtUtils/Liblist.pm blib/lib/ExtUtils/Liblist.pm
cp lib/ExtUtils/MM_Darwin.pm blib/lib/ExtUtils/MM_Darwin.pm
cp lib/ExtUtils/MM_AIX.pm blib/lib/ExtUtils/MM_AIX.pm
cp inc/CPAN/Meta/Requirements.pm blib/lib/CPAN/Meta/Requirements.pm
cp lib/ExtUtils/Liblist/Kid.pm blib/lib/ExtUtils/Liblist/Kid.pm
cp lib/ExtUtils/MakeMaker/FAQ.pod blib/lib/ExtUtils/MakeMaker/FAQ.pod
cp inc/ExtUtils/MANIFEST.SKIP blib/lib/ExtUtils/MANIFEST.SKIP
cp lib/ExtUtils/MM_NW5.pm blib/lib/ExtUtils/MM_NW5.pm
cp lib/ExtUtils/MakeMaker.pm blib/lib/ExtUtils/MakeMaker.pm
cp lib/ExtUtils/MM_OS2.pm blib/lib/ExtUtils/MM_OS2.pm
cp inc/CPAN/Meta/Feature.pm blib/lib/CPAN/Meta/Feature.pm
cp lib/ExtUtils/Command.pm blib/lib/ExtUtils/Command.pm
cp lib/ExtUtils/MM_Unix.pm blib/lib/ExtUtils/MM_Unix.pm
cp lib/ExtUtils/MM_Win32.pm blib/lib/ExtUtils/MM_Win32.pm
cp inc/ExtUtils/Installed.pm blib/lib/ExtUtils/Installed.pm
cp inc/JSON/PP/Boolean.pm blib/lib/JSON/PP/Boolean.pm
cp inc/CPAN/Meta/Spec.pm blib/lib/CPAN/Meta/Spec.pm
cp inc/CPAN/Meta/History.pm blib/lib/CPAN/Meta/History.pm
cp lib/ExtUtils/MY.pm blib/lib/ExtUtils/MY.pm
cp inc/ExtUtils/Packlist.pm blib/lib/ExtUtils/Packlist.pm
cp lib/ExtUtils/MM_MacOS.pm blib/lib/ExtUtils/MM_MacOS.pm
cp lib/ExtUtils/MM_VMS.pm blib/lib/ExtUtils/MM_VMS.pm
cp inc/CPAN/Meta/Merge.pm blib/lib/CPAN/Meta/Merge.pm
cp lib/ExtUtils/MM_BeOS.pm blib/lib/ExtUtils/MM_BeOS.pm
cp lib/ExtUtils/MM_QNX.pm blib/lib/ExtUtils/MM_QNX.pm
cp inc/CPAN/Meta/YAML.pm blib/lib/CPAN/Meta/YAML.pm
cp inc/CPAN/Meta/Converter.pm blib/lib/CPAN/Meta/Converter.pm
cp inc/ExtUtils/Install.pm blib/lib/ExtUtils/Install.pm
cp lib/ExtUtils/Command/MM.pm blib/lib/ExtUtils/Command/MM.pm
cp lib/ExtUtils/MakeMaker/Config.pm blib/lib/ExtUtils/MakeMaker/Config.pm
cp inc/CPAN/Meta.pm blib/lib/CPAN/Meta.pm
cp inc/CPAN/Meta/Prereqs.pm blib/lib/CPAN/Meta/Prereqs.pm
cp inc/Parse/CPAN/Meta.pm blib/lib/Parse/CPAN/Meta.pm
cp inc/CPAN/Meta/Validator.pm blib/lib/CPAN/Meta/Validator.pm
cp lib/ExtUtils/MM_Any.pm blib/lib/ExtUtils/MM_Any.pm
cp lib/ExtUtils/MakeMaker/Tutorial.pod blib/lib/ExtUtils/MakeMaker/Tutorial.pod
cp lib/ExtUtils/Mkbootstrap.pm blib/lib/ExtUtils/Mkbootstrap.pm
cp lib/ExtUtils/Mksymlists.pm blib/lib/ExtUtils/Mksymlists.pm
cp lib/ExtUtils/MakeMaker/version/regex.pm blib/lib/ExtUtils/MakeMaker/version/regex.pm
cp lib/ExtUtils/testlib.pm blib/lib/ExtUtils/testlib.pm
cp lib/ExtUtils/MakeMaker/Locale.pm blib/lib/ExtUtils/MakeMaker/Locale.pm
cp lib/ExtUtils/MakeMaker/version.pm blib/lib/ExtUtils/MakeMaker/version.pm
cp lib/ExtUtils/MakeMaker/version/vpp.pm blib/lib/ExtUtils/MakeMaker/version/vpp.pm
cp bin/instmodsh blib/script/instmodsh
"/usr/bin/perl" -Iinc "-Iblib/arch" "-Iblib/lib" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/instmodsh
Manifying 1 pod document
Manifying 38 pod documents
Manifying 8 pod documents
PERL_DL_NONLAZY=1 "/usr/bin/perl" -Iinc "-Iblib/arch" "-Iblib/lib" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't locate Test/Harness.pm in @INC (@INC contains: inc blib/arch blib/lib /home/adm/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
make: *** [test_dynamic] Error 2
-> FAIL Installing ExtUtils::MakeMaker failed. See /home/adm/.cpanm/work/1554912566.4667/build.log for details. Retry with --force to force install it.

「Can't locate Test/Harness.pm」エラー対処

cpanmでモジュールインストール失敗時に、そのログに「Can't locate Test/Harness.pm」エラーが出ている。

ビルド自体には成功してもテスト時に失敗してインストール自体が失敗している?

テストを行わない設定にしたらインストールできる?

ここでは該当モジュールをyumからインストール

# yum -y install perl-Test-Harness
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.tsukuba.wide.ad.jp
 * remi-safe: ftp.riken.jp
 * updates: ftp.tsukuba.wide.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package           Arch       Version      Repository  Size
================================================================================
Installing:
 perl-Test-Harness     noarch     3.28-3.el7     base     302 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 302 k
Installed size: 593 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Test-Harness-3.28-3.el7.noarch              1/1 
  Verifying  : perl-Test-Harness-3.28-3.el7.noarch              1/1 

Installed:
  perl-Test-Harness.noarch 0:3.28-3.el7                     

Complete!
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.34.tar.gz ... OK
Configuring ExtUtils-MakeMaker-7.34 ... OK
Building and testing ExtUtils-MakeMaker-7.34 ... OK
Successfully installed ExtUtils-MakeMaker-7.34
1 distribution installed
$ cpanm LWP
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on LWP
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.38.tar.gz ... OK
==> Found dependencies: Module::Metadata
--> Working on Module::Metadata
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Module-Metadata-1.000033.tar.gz ... OK
Configuring Module-Metadata-1.000033 ... OK
==> Found dependencies: version, Test::More
--> Working on version
Fetching http://www.cpan.org/authors/id/J/JP/JPEACOCK/version-0.9924.tar.gz ... OK
Configuring version-0.9924 ... ! Configure failed for version-0.9924. See /home/adm/.cpanm/work/1554915600.7199/build.log for details.
N/A
--> Working on Test::More
Fetching http://www.cpan.org/authors/id/E/EX/EXODIST/Test-Simple-1.302162.tar.gz ... OK
Configuring Test-Simple-1.302162 ... OK
Building and testing Test-Simple-1.302162 ... OK
Successfully installed Test-Simple-1.302162
! Installing the dependencies failed: Module 'version' is not installed
! Bailing out the installation for Module-Metadata-1.000033.
! Installing the dependencies failed: Module 'Module::Metadata' is not installed
! Bailing out the installation for libwww-perl-6.38.
1 distribution installed

「Can't locate DBD/mysql.pm」エラー対処

ブラウザ上の表示

Software error:
install_driver(mysql) failed: Can't locate DBD/mysql.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 (eval 12) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
 at ../config.pl line 107.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

Software error:
[Thu Apr 11 16:20:07 2019] index.cgi: install_driver(mysql) failed: Can't locate DBD/mysql.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 (eval 12) line 3.
[Thu Apr 11 16:20:07 2019] index.cgi: Perhaps the DBD::mysql perl module hasn't been fully installed,
[Thu Apr 11 16:20:07 2019] index.cgi: or perhaps the capitalisation of 'mysql' isn't right.
[Thu Apr 11 16:20:07 2019] index.cgi: Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
[Thu Apr 11 16:20:07 2019] index.cgi:  at ../config.pl line 107.
Compilation failed in require at /var/www/html/note-pc.biz/public_html/cgi/mitumori/admin/index.cgi line 8.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

Apacheエラーログ(error_log)の表示

[Thu Apr 11 17:02:33.655516 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: [Thu Apr 11 17:02:33 2019] index.cgi: install_driver(mysql) failed: Can't locate DBD/mysql.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 (eval 12) line 3., referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/
[Thu Apr 11 17:02:33.655650 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: [Thu Apr 11 17:02:33 2019] index.cgi: Perhaps the DBD::mysql perl module hasn't been fully installed,, referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/
[Thu Apr 11 17:02:33.655728 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: [Thu Apr 11 17:02:33 2019] index.cgi: or perhaps the capitalisation of 'mysql' isn't right., referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/
[Thu Apr 11 17:02:33.655808 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: [Thu Apr 11 17:02:33 2019] index.cgi: Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge., referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/
[Thu Apr 11 17:02:33.655868 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: [Thu Apr 11 17:02:33 2019] index.cgi:  at ../config.pl line 107., referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/
[Thu Apr 11 17:02:33.656652 2019] [cgi:error] [pid 3590] [client 10.0.2.2:57490] AH01215: [Thu Apr 11 17:02:33 2019] index.cgi: Compilation failed in require at /var/www/html/note-pc.biz/public_html/cgi/mitumori/admin/index.cgi line 8., referer: http://localhost:20081/note-pc.biz/public_html/cgi/mitumori/admin/

cpanmコマンドでDBD::mysqlのインストール

$ cpanm DBD::mysql
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
==> Found dependencies: Devel::CheckLib
--> Working on Devel::CheckLib
Fetching http://www.cpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.13.tar.gz ... OK
Configuring Devel-CheckLib-1.13 ... OK
==> Found dependencies: IO::CaptureOutput, Mock::Config
--> Working on IO::CaptureOutput
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/IO-CaptureOutput-1.1104.tar.gz ... OK
Configuring IO-CaptureOutput-1.1104 ... OK
Building and testing IO-CaptureOutput-1.1104 ... OK
Successfully installed IO-CaptureOutput-1.1104
--> Working on Mock::Config
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/Mock-Config-0.03.tar.gz ... OK
Configuring Mock-Config-0.03 ... OK
Building and testing Mock-Config-0.03 ... OK
Successfully installed Mock-Config-0.03
Building and testing Devel-CheckLib-1.13 ... OK
Successfully installed Devel-CheckLib-1.13
Configuring DBD-mysql-4.050 ... ! Configure failed for DBD-mysql-4.050. See /home/adm/.cpanm/work/1554969630.8814/build.log for details.
N/A
3 distributions installed

「cpanm DBD::mysql」実行時に表示されている以下ログの内容を確認

Configuring DBD-mysql-4.050 ... ! Configure failed for DBD-mysql-4.050. See /home/adm/.cpanm/work/1554969630.8814/build.log for details.
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /home/adm/.cpanm/work/1554969630.8814
You have make /bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 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.

Written by John Gilmore and Jay Fenlason.
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
Searching DBD::mysql () on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
-> OK
Unpacking DBD-mysql-4.050.tar.gz
Entering DBD-mysql-4.050
Checking configure dependencies from META.json
Checking if you have Devel::CheckLib 1.09 ... No
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Data::Dumper 0 ... Yes (2.145)
Checking if you have DBI 1.609 ... Yes (1.627)
==> Found dependencies: Devel::CheckLib
Searching Devel::CheckLib (1.09) on cpanmetadb ...
--> Working on Devel::CheckLib
Fetching http://www.cpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.13.tar.gz
-> OK
Unpacking Devel-CheckLib-1.13.tar.gz
Entering Devel-CheckLib-1.13
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring Devel-CheckLib-1.13
Running Makefile.PL
Warning: prerequisite IO::CaptureOutput 1.0801 not found.
Warning: prerequisite Mock::Config 0.02 not found.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Devel::CheckLib
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have IO::CaptureOutput 1.0801 ... No
Checking if you have File::Spec 0 ... Yes (3.40)
Checking if you have Mock::Config 0.02 ... No
Checking if you have Exporter 0 ... Yes (5.68)
Checking if you have Test::More 0.62 ... Yes (1.302162)
Checking if you have File::Temp 0.16 ... Yes (0.2301)
==> Found dependencies: IO::CaptureOutput, Mock::Config
Searching IO::CaptureOutput (1.0801) on cpanmetadb ...
--> Working on IO::CaptureOutput
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/IO-CaptureOutput-1.1104.tar.gz
-> OK
Unpacking IO-CaptureOutput-1.1104.tar.gz
Entering IO-CaptureOutput-1.1104
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring IO-CaptureOutput-1.1104
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for IO::CaptureOutput
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have warnings 0 ... Yes (1.13)
Checking if you have IO::File 0 ... Yes (1.16)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have File::Spec 3.27 ... Yes (3.40)
Checking if you have vars 0 ... Yes (1.02)
Checking if you have Exporter 0 ... Yes (5.68)
Checking if you have Symbol 0 ... Yes (1.07)
Checking if you have Carp 0 ... Yes (1.26)
Checking if you have Test::More 0.62 ... Yes (1.302162)
Checking if you have strict 0 ... Yes (1.07)
Checking if you have File::Temp 0.16 ... Yes (0.2301)
Checking if you have File::Basename 0 ... Yes (2.84)
Building and testing IO-CaptureOutput-1.1104
cp lib/IO/CaptureOutput.pm blib/lib/IO/CaptureOutput.pm
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# 
# Versions for all modules listed in MYMETA.json (including optional ones):
# 
# === Configure Requires ===
# 
#   Module        Want Have
#   ------------------- ---- ----
#   ExtUtils::MakeMaker 6.17 7.34
# 
# === Build Requires ===
# 
#   Module        Want Have
#   ------------------- ---- ----
#   ExtUtils::MakeMaker  any 7.34
# 
# === Test Requires ===
# 
#   Module        Want   Have
#   ------------------- ---- --------
#   ExtUtils::MakeMaker  any   7.34
#   File::Spec      3.27   3.40
#   IO::File       any   1.16
#   Test::More      0.62 1.302162
# 
# === Test Recommends ===
# 
#   Module     Want   Have
#   ---------- -------- --------
#   CPAN::Meta 2.120900 2.143240
# 
# === Runtime Requires ===
# 
#   Module     Want   Have
#   -------------- ---- ------
#   Carp      any   1.26
#   Exporter    any   5.68
#   File::Basename  any   2.84
#   File::Temp   0.16 0.2301
#   Symbol      any   1.07
#   strict      any   1.07
#   vars      any   1.02
#   warnings    any   1.13
# 
t/00-report-prereqs.t .. ok
t/capture.t ............ ok
t/capture_exec.t ....... ok
t/capture_file.t ....... ok
t/errors.t ............. ok
t/noconsole.t .......... ok
t/wperl.t .............. skipped: not MSWin32
All tests successful.
Files=7, Tests=105,  2 wallclock secs ( 0.04 usr  0.01 sys +  0.55 cusr  0.13 csys =  0.73 CPU)
Result: PASS
Manifying 1 pod document
Installing /home/adm/perl5/lib/perl5/IO/CaptureOutput.pm
Installing /home/adm/perl5/man/man3/IO::CaptureOutput.3pm
Appending installation info to /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
-> OK
Successfully installed IO-CaptureOutput-1.1104
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/IO-CaptureOutput-1.1104/install.json
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/IO-CaptureOutput-1.1104/MYMETA.json
Searching Mock::Config (0.02) on cpanmetadb ...
--> Working on Mock::Config
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/Mock-Config-0.03.tar.gz
-> OK
Unpacking Mock-Config-0.03.tar.gz
Entering Mock-Config-0.03
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring Mock-Config-0.03
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Mock::Config
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0 ... Yes (1.302162)
Building and testing Mock-Config-0.03
cp lib/Mock/Config.pm blib/lib/Mock/Config.pm
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Use of uninitialized value $Config::VERSION in concatenation (.) or string at t/0-basic.t line 15.
# Testing Mock::Config, Perl 5.016003, Config , /usr/bin/perl
t/0-basic.t ....... ok
t/manifest.t ...... skipped: requires a git checkout and a unix for git and diff
t/pod-coverage.t .. skipped: Author tests not required for installation
t/pod.t ........... skipped: Author tests not required for installation
All tests successful.
Files=4, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.18 cusr  0.02 csys =  0.22 CPU)
Result: PASS
Manifying 1 pod document
Installing /home/adm/perl5/lib/perl5/Mock/Config.pm
Installing /home/adm/perl5/man/man3/Mock::Config.3pm
Appending installation info to /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
-> OK
Successfully installed Mock-Config-0.03
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/Mock-Config-0.03/install.json
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/Mock-Config-0.03/MYMETA.json
Building and testing Devel-CheckLib-1.13
cp lib/Devel/CheckLib.pm blib/lib/Devel/CheckLib.pm
cp bin/use-devel-checklib blib/script/use-devel-checklib
"/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/use-devel-checklib
Manifying 1 pod document
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ................... ok
t/analyze-binary.t ............ ok
t/bad-single-word-compiler.t .. ok
t/cmdline-LIBS-INC.t .......... ok
t/custom-function.t ........... ok
t/dash-l-libs.t ............... ok
t/exit_with_message.t ......... ok
t/flags.t ..................... ok
t/found.t ..................... ok
t/headers.t ................... ok
t/multi-word-compiler.t ....... ok
t/not_found.t ................. ok
All tests successful.
Files=12, Tests=42,  3 wallclock secs ( 0.05 usr  0.01 sys +  1.94 cusr  0.89 csys =  2.89 CPU)
Result: PASS
Manifying 1 pod document
Manifying 1 pod document
Installing /home/adm/perl5/lib/perl5/Devel/CheckLib.pm
Installing /home/adm/perl5/man/man1/use-devel-checklib.1
Installing /home/adm/perl5/man/man3/Devel::CheckLib.3pm
Installing /home/adm/perl5/bin/use-devel-checklib
Appending installation info to /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
-> OK
Successfully installed Devel-CheckLib-1.13
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/Devel-CheckLib-1.13/install.json
Installing /home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/.meta/Devel-CheckLib-1.13/MYMETA.json
Configuring DBD-mysql-4.050
Running Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 89.

Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'adm' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'adm'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Failed to determine directory of mysql.h. Use

  perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see DBD::mysql::INSTALL,
section "C Compiler flags" or type

  perl Makefile.PL --help
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
-> N/A
-> FAIL Configure failed for DBD-mysql-4.050. See /home/adm/.cpanm/work/1554969630.8814/build.log for details.
3 distributions installed

「Can't find mysql_config.」とあるので「mysql_config」のインストールを試みる

MySQLのYumリポジトリを追加

https://dev.mysql.com/downloads/repo/yum/

https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

# rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

再度cpanmコマンドでDBD::mysqlのインストール

$ cpanm DBD::mysql
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... ! Configure failed for DBD-mysql-4.050. See /home/adm/.cpanm/work/1554976117.13509/build.log for details.
N/A
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /home/adm/.cpanm/work/1554976117.13509
You have make /bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 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.

Written by John Gilmore and Jay Fenlason.
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
Searching DBD::mysql () on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
-> OK
Unpacking DBD-mysql-4.050.tar.gz
Entering DBD-mysql-4.050
Checking configure dependencies from META.json
Checking if you have Devel::CheckLib 1.09 ... Yes (1.13)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Data::Dumper 0 ... Yes (2.145)
Checking if you have DBI 1.609 ... Yes (1.627)
Configuring DBD-mysql-4.050
Running Makefile.PL


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'adm' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'adm'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags    (mysql_config) = -I/usr/include/mysql -m64
  embedded    (mysql_config) = 
  ldflags     (guessed   ) = 
  libs      (mysql_config) = -L/usr/lib64/mysql -lmysqlclient -lpthread -lm -lrt -ldl
  mysql_config  (guessed   ) = mysql_config
  nocatchstderr (default   ) = 0
  nofoundrows   (default   ) = 0
  nossl     (default   ) = 0
  testdb    (default   ) = test
  testhost    (default   ) = 
  testpassword  (default   ) = 
  testport    (default   ) = 
  testsocket  (default   ) = 
  testuser    (guessed   ) = adm

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Warning: prerequisite Test::Deep 0 not found.
Looks good.

Checking if your kit is complete...
Looks good
ExtUtils::MM_Unix::tool_xsubpp : Can't find xsubpp at /home/adm/perl5/lib/perl5/ExtUtils/MM_Unix.pm line 3790.
-> N/A
-> FAIL Configure failed for DBD-mysql-4.050. See /home/adm/.cpanm/work/1554976117.13509/build.log for details.

「ExtUtils::MM_Unix::tool_xsubpp : Can't find xsubpp」と出てるので

「perl-devel」インストールで解決できそう

# yum -y install perl-devel.x86_64

再度cpanmコマンドでDBD::mysqlのインストール

$ cpanm DBD::mysql
!
! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing modules to /home/adm/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl5 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!     cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... OK
==> Found dependencies: Test::Deep
--> Working on Test::Deep
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Test-Deep-1.128.tar.gz ... OK
Configuring Test-Deep-1.128 ... OK
Building and testing Test-Deep-1.128 ... OK
Successfully installed Test-Deep-1.128
Building and testing DBD-mysql-4.050 ... OK
Successfully installed DBD-mysql-4.050
2 distributions installed

「mysql.pm」を検索してみたら以下ディレクトリには入ってた。

# find / -name "mysql.pm"
/home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/Bundle/DBD/mysql.pm
/home/adm/perl5/lib/perl5/x86_64-linux-thread-multi/DBD/mysql.pm

MariaDBのアンインストールと、MySQLのインストールも試してみた。

「mysql_config」は「mysql-community-devel.x86_64」に含まれていた。

# yum remove mariadb-libs
# rm -rf /var/lib/mysql/
# rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# yum -y install mysql-community-server
# yum -y install mysql-community-devel.x86_64

該当perlスクリプトに「use lib」でパスを追加してみたけど、エラーは変わらなかった。

use lib '/home/adm/perl5/lib/perl5/x86_64-linux-thread-multi';

まだエラー出てたのでyumコマンドでDBD::mysqlのインストールしたら該当エラーは解消された。

# yum -y install "perl(DBD::mysql)"

再度「mysql.pm」を検索してみたら以下ディレクトリに追加されていた。

# find / -name "mysql.pm"
/usr/lib64/perl5/vendor_perl/Bundle/DBD/mysql.pm
/usr/lib64/perl5/vendor_perl/DBD/mysql.pm

MySQL5.7の初期rootパスワード

$ mysqld --version
mysqld  Ver 5.7.25 for Linux on x86_64 (MySQL Community Server (GPL))

「/var/log/mysqld.log」ファイルに記載されている。

$ grep 'A temporary password is generated for root@localhost:' /var/log/mysqld.log
2019-04-11T10:24:25.949050Z 1 [Note] A temporary password is generated for root@localhost: (iy7NKd+ql1s

MySQL初期設定

# mysql_secure_installation