安装 DBI Perl 模块时出错

Error When Installing DBI Perl Module

这是我的输出,有什么建议吗?我尝试通过 perl -MCPAN -e shell 安装,然后强制安装 DBI。

cpan[10]> force install DBI
Running install for module 'DBI'
Running make for T/TI/TIMB/DBI-1.636.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/DBI-1.636-sGWX9V

  CPAN.pm: Building T/TI/TIMB/DBI-1.636.tar.gz

gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic   -DVERSION=\"1.636\" -DXS_VERSION=\"1.636\" -fPIC "-I/usr/lib64/perl5/CORE"  -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c
/bin/sh: gcc: command not found
make: *** [Perl.o] Error 127
  TIMB/DBI-1.636.tar.gz
  /bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 TIMB/DBI-1.636.tar.gz                        : make NO

错误信息:

    /bin/sh: gcc: command not found

所以你需要安装gcc

如您所见,安装 gcc 将解决问题。

但是我想知道你为什么不使用预打包版本

$ sudo yum install perl-DBI

另外,您知道现在不支持 Fedora 20 了吗?我强烈建议您升级到受支持的版本(Fedora 24 或 25)。