Perl cpanm:无法安装 DB_File

Perl cpanm: Cannot install DB_File

我正在尝试安装 Perl 包 Vcf,它有很多依赖项。这些依赖项之一 DB_File 将不会安装。

con@VB:~$ cpanm DB_File
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.852.tar.gz ... OK
Configuring DB_File-1.852 ... OK
Building and testing DB_File-1.852 ... FAIL
! Installing DB_File failed. See /home/con/.cpanm/work/1567015698.27372/build.log for details. Retry with --force to force install it.
con@VB:~$ cat /home/con/.cpanm/work/1567015698.27372/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.030000 built for x86_64-linux
Work directory is /home/con/.cpanm/work/1567015698.27372
You have make /usr/bin/make
You have LWP 6.39
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 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.
You have /usr/bin/unzip
Searching DB_File () on cpanmetadb ...
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.852.tar.gz
-> OK
Unpacking DB_File-1.852.tar.gz
Entering DB_File-1.852
Checking configure dependencies from META.json
Configuring DB_File-1.852
Running Makefile.PL
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -ldb
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Building and testing DB_File-1.852
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/home/con/perl5/perlbrew/perls/perl-5.30.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
cc -c  -I/usr/local/BerkeleyDB/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"1.852\" -DXS_VERSION=\"1.852\" -fPIC "-I/home/con/perl5/perlbrew/perls/perl-5.30.0/lib/5.30.0/x86_64-linux/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c
version.c:30:10: fatal error: db.h: No such file or directory
 #include <db.h>
          ^~~~~~
compilation terminated.
Makefile:353: recipe for target 'version.o' failed
make: *** [version.o] Error 1
-> FAIL Installing DB_File failed. See /home/con/.cpanm/work/1567015698.27372/build.log for details. Retry with --force to force install it

在构建 DB_File 之前,您需要在计算机上安装 libdb 开发库 — 这可能来自系统包管理器中名为 libdb-devlibdb-devel 的包。