grahamsc has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm trying to install DBI on brand new Ubuntu 12.04 LTS server edition. It is coming back "make -- NOT OK" and then fails. How should I go about getting this to work?

Thanks, Graham

Issued command:

sudo perl -MCPAN -e "install DBI"

Response:

/usr/bin/perl /usr/share/perl/5.14/ExtUtils/xsubpp -typemap /usr/shar +e/perl/5.14/ExtUtils/typemap -typemap typemap Perl.xs > Perl.xsc && +mv Perl.xsc Perl.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe + -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_O +FFSET_BITS=64 -O2 -g -DVERSION=\"1.622\" -DXS_VERSION=\"1.622\" -fP +IC "-I/usr/lib/perl/5.14/CORE" -W -Wall -Wpointer-arith -Wbad-functi +on-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noret +urn -Wno-unused-parameter Perl.c /bin/sh: 1: cc: not found make: *** [Perl.o] Error 127 TIMB/DBI-1.622.tar.gz make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible

Replies are listed 'Best First'.
Re: Installing DBI on Ubuntu 12.04
by davido (Cardinal) on Jul 24, 2012 at 05:30 UTC

    The error message is telling you that your C compiler can't be found. Do you have 'gcc' installed on your system? You might have to go fetch the dpkg using Synaptic Package Manager, or sudo apt-get install gcc from the command line.

    For what it's worth, on my two Ubuntu 12.04 systems DBI installed without a problem. If the traditional means continues to be stubborn, you could always sudo apt-get install libdbi-perl and install the Debian pre-compiled version.

    At some point you might decide as have many before you that it's best to just leave system Perl alone, and use perlbrew to install your own copy of Perl that doesn't need root privileges just to install modules, although that's really just a footnote: You need a C compiler either way.


    Dave

      Hi guys, Thanks. I didn't have gcc and other stuff installed. Newbee error. Thanks for everyone's help. Graham
Re: Installing DBI on Ubuntu 12.04
by frozenwithjoy (Priest) on Jul 24, 2012 at 04:36 UTC
    Here are three people that all had the same problem and seem to have solved in in three different ways. Maybe look to see if any of these apply?

    edit: here is another approach. It might be as simple as apt-get install make. By the way, what do you get if you type which make?

Re: Installing DBI on Ubuntu 12.04
by Anonymous Monk on Jul 24, 2012 at 04:38 UTC
    sudo apt-get install build-essential