# Installling Perl Module DBI on Linux CentOS - Head exploding

**URL:** <https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502>\
**Category:** Factual Questions\
**Created:** [December 17, 2010, 1:43pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502 "2010-12-17T13:43:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 1:43pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/1 "2010-12-17T13:43:10Z")

</div>

Okay, I was good, I searched, I studied, I read..and I stopped myself from becoming hysterical at how complex and daunting it appears and I know it can’t be that bad.

I want to see if a particular program I’ve been paying for is going to work for me. It is easy to install…if my Perl is set up correctly, which it evidently is not.

I have everything I need except the DBI Module for Perl, which is evidently a pretty important and frequently used module. I looked it up on Cpan and of course got ten gazillion hits, but on the first page was DBI Bundle, which certainly seemed like the ticket:

"A bundle to install DBI and required modules. "

So I looked up on Cpan [How to Install Modules](http://www.cpan.org/modules/INSTALL.html), and it seemed less overwhelming than most of the other pages I’d seen and I actually made some progress.

Here are the UNIX (i’m linux..) directions in their entirety:

> [@](#):
>
> Also note that these instructions are tailored for installing the module into your system’s repository of Perl modules. But you can install modules into any directory you wish. For instance, where I say perl Makefile.PL, you can substitute perl Makefile.PL PREFIX=/my/perl\_directory to install the modules into /my/perl\_directory. Then you can use the modules from your Perl programs with use lib “/my/perl\_directory/lib/site\_perl”; or sometimes just use “/my/perl\_directory”;.
> 
> If you’re on Unix,  
> (You can use Andreas König’s CPAN module to automate the entire process, from DECOMPRESS through INSTALL.)
> 
> **A. DECOMPRESS**
> 
> Decompress the file with gzip -d yourmodule.tar.gz  
> You can get gzip from ftp://prep.ai.mit.edu/pub/gnu.
> 
> Or, you can combine this step with the next to save disk space:
> 
> gzip -dc yourmodule.tar.gz | tar -xof -
> 
> **B. UNPACK**  
> Unpack the result with tar -xof yourmodule.tar
> 
> **C. BUILD**  
> Go into the newly-created directory and type:
> 
> perl Makefile.PL  
> make  
> make test
> 
> **D. INSTALL**  
> While still in that directory, type:
> 
> make install  
> Make sure you have the appropriate permissions to install the module in your Perl 5 library directory. Often, you’ll need to be root.
> 
> That’s all you need to do on Unix systems with dynamic linking. Most Unix systems have dynamic linking – if yours doesn’t, or if for another reason you have a statically-linked perl, and the module requires compilation, you’ll need to build a new Perl binary that includes the module. Again, you’ll probably need to be root.

I’m amazed to report that I somehow managed to download the DBI tar file to my computer, then, using Cyberduck, upload it to my server. (I had never FTP’d via command line or as root before)

but now I’m not really clear about the directory structure…I found a command to tell me what my perl modules are:

instmodsh, then L and it reported that installed modules are  
Perl  
Text::Iconv

Which was how I knew I didn’t have DBI. But I don’t know where those two things actually are, since when I type “ls” i got nuthin until I uploaded DBI-1-1.615.tar.gz, which is what I see now when I type “ls”.

And that’s why I’m here. If you look under decompress it says “Also note that these instructions are tailored for installing the module into your system’s repository of Perl modules.” and I have no idea where that is.

This stuff gives me hives, but I’m willing to press forward with a little help. ALl I want is to get this thing in so that I can try out the thing I REALLY want to try out…which may suck anyway, so i don’t want to kill myself with this stuff.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![EristicKallistic](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@EristicKallistic](https://boards.straightdope.com/u/EristicKallistic)\
**Post date:** [December 17, 2010, 3:28pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/2 "2010-12-17T15:28:30Z")

</div>

Well, the install program should do all of the “figuring out where the module repository” stuff is automatically, so I’d just continue on following the steps of the instructions.

That said, if you really want to know where your system stores modules, run the command ‘perl -V’ and it will show you (you will get a list starting with “@INC:”)

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [December 17, 2010, 3:29pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/3 "2010-12-17T15:29:51Z")

</div>

First, try the CPAN shell approach as documented [here](http://www.troubleshooters.com/codecorn/littperl/perlcpan.htm)

```auto

perl -MCPAN -e 'shell'

```

You will probably need to configure CPAN, in general, the defaults just work (although watch your location and timezone).

then

```auto

install DBI

```

Of course, if CPAN is not installed you may have more difficulties. What flavour (distro) linux are you using? - sorry just noticed it is Centos - which version?

Si

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [December 17, 2010, 3:46pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/4 "2010-12-17T15:46:40Z")

</div>

And you can do everything from your home directory. The untar will create a directory containing the expanded files. cd into that directory, and you should find the **Makefile.PL**

_perl ./Makefile.PL_ will figure out where perl lives and build a suitable makefile for your system.  
_make_ will run configure to set up library paths and identify missing libraries, and then compile the module.  
_make install_ will copy the compiled module into the perl directories.

Actually, if you can use yum try **yum install perl-DBI** - it is the recommended approach for rpm-based systems

si

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [December 17, 2010, 4:51pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/5 "2010-12-17T16:51:09Z")

</div>

> [@si\_blakely](#):
>
> Actually, if you can use yum try **yum install perl-DBI** - it is the recommended approach for rpm-based systems

Right. If your distro has a package management system, use it unless you know why you can’t.

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 8:58pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/6 "2010-12-17T20:58:24Z")

</div>

> [@EristicKallistic](#):
>
> Well, the install program should do all of the “figuring out where the module repository” stuff is automatically, so I’d just continue on following the steps of the instructions.
> 
> That said, if you really want to know where your system stores modules, run the command ‘perl -V’ and it will show you (you will get a list starting with “@INC:”)

I had done that already to check the version. No @INC anything. It just says “This is perl, v5.8.8, built for x86\_64-linux blah blah…”

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 9:00pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/7 "2010-12-17T21:00:30Z")

</div>

I had discovered the yum thing, but then ran into a bunch of scary information that made me abandon it. I am also aware of some cpan installer thing…but overall what I’m trying to avoid is adding/doing/configuring more than absolutely necessary, since my track record with command line/linux is definitely less is more and more is bad.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 17, 2010, 9:00pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/8 "2010-12-17T21:00:50Z")

</div>

-V, not -v.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [December 17, 2010, 9:26pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/9 "2010-12-17T21:26:22Z")

</div>

> [@Stoid](#):
>
> I had discovered the yum thing, but then ran into a bunch of scary information that made me abandon it. I am also aware of some cpan installer thing…but overall what I’m trying to avoid is adding/doing/configuring more than absolutely necessary, since my track record with command line/linux is definitely less is more and more is bad.

_yum_ has probably found some **dependencies** - if you try to manually generate your package, you will have to fulfill these dependencies first. This can be even more of a nightmare, and trying to do less will create more work and frustration as you as you try to get headers and shared libraries installed.

If you are on Centos, get a handle on using _yum_ - it does make things much easier, and is generally reliable. And you can use yum to keep your system up to date and secure - _yum update_ is all you need.

Si

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 17, 2010, 9:28pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/10 "2010-12-17T21:28:40Z")

</div>

Using your native package manager is the best way to install CPAN modules for your system Perl installation, as others have said. So do the yum thing. The CPAN toolchain is great, but can wreak havoc with system-installed Perls. That’s why I always install my own local Perl for development and leave the system one alone.

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 9:32pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/11 "2010-12-17T21:32:34Z")

</div>

Okay, I’m following the instructions and here’s where I am:

> [@](#):
>
> -bash-3.2$ perl Makefile.PL
> 
> \*\*\* Your LANG environment variable is set to ‘en\_US.UTF-8’  
> \*\*\* This may cause problems for some perl installations.  
> \*\*\* If you get test failures, please try again with LANG unset.  
> \*\*\* If that then works, please email [dbi-dev@perl.org](mailto:dbi-dev@perl.org) with details  
> \*\*\* including the output of ‘perl -V’  
> \*\*\* You are using a perl configured with threading enabled.  
> \*\*\* You should be aware that using multiple threads is  
> \*\*\* not recommended for production environments.
> 
> Your perl was compiled with gcc (version 4.1.2 20080704 (Red Hat 4.1.2-46)), okay.  
> Creating test wrappers for DBD::Gofer:  
> t/zvg\_01basics.t  
> t/zvg\_02dbidrv.t  
> t/zvg\_03handle.t  
> t/zvg\_04mods.t  
> t/zvg\_05concathash.t  
> t/zvg\_06attrs.t  
> t/zvg\_07kids.t  
> t/zvg\_08keeperr.t
> 
> **(MORE LIKE THIS for a screen or two, THEN: )**
> 
> Checking if your kit is complete…  
> Looks good  
> Warning: prerequisite ExtUtils::MakeMaker 6.48 not found. We have 6.30.  
> Warning: prerequisite Test::Simple 0.90 not found. We have 0.62.
> 
> ```
> I see you're using perl 5.008008 on x86_64-linux-thread-multi, okay.
> Remember to actually *read* the README file!
> Use 'make' to build the software (dmake or nmake on Windows).
> Then 'make test' to execute self tests.
> Then 'make install' to install the DBI and then delete this working
> directory before unpacking and building any DBD::* drivers.
> 
> ```
> 
> Writing Makefile for DBI  
> -bash-3.2$

I don’t know what’s to be gained from the README, since I pretty much don’t know what I’m doing. And I’m pretty sure that the DBD drivers part isn’t on me, that will be handled by the script.

But I’m concerned about the

> [@](#):
>
> Warning: prerequisite ExtUtils::MakeMaker 6.48 not found. We have 6.30.  
> Warning: prerequisite Test::Simple 0.90 not found. We have 0.62.

You don’t have/we have part… either it’s gonna work or not. Suggstions?

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 9:35pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/12 "2010-12-17T21:35:22Z")

</div>

Is there a good resource for baseline understanding of using yum that has the decency to treat me like the completely clueless noob that I am?

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 9:37pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/13 "2010-12-17T21:37:40Z")

</div>

and is there any way to know if yum is already there and ready to work or I have to learn how to install that first?

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [December 17, 2010, 9:45pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/14 "2010-12-17T21:45:35Z")

</div>

**Stoid** , if I were you I would put an ad up in the Marketplace forum asking for someone who’d be interested in helping to manage your Linux server.

I’m a big computer nerd and I manage Web sites and Windows servers all day, and I can’t figure any of the Linux stuff out (we had to set up a Linux server for one of our clients). I went round and round like you are doing, and it drove me batty until I finally managed to find a friend who could do this stuff.

As you can see there’s plenty of Linux-proficient cats here on the board. They can probably do stuff in 10 mins that it would take you or I three days to do!

You won’t regret it.

---

<div class="post-metadata">

**Author:** ![Stoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/stoid/32/272_2.png) [@Stoid](https://boards.straightdope.com/u/Stoid)\
**Post date:** [December 17, 2010, 10:14pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/15 "2010-12-17T22:14:34Z")

</div>

No spare $$ or I would. ☹ Gotta scratch for free advice.

---

<div class="post-metadata">

**Author:** ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)\
**Post date:** [December 17, 2010, 10:40pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/16 "2010-12-17T22:40:01Z")

</div>

> [@Stoid](#):
>
> No spare $$ or I would. ☹ Gotta scratch for free advice.

You’ve gotten good free advice (use your system’s package manager) but you haven’t followed it.

---

<div class="post-metadata">

**Author:** ![si\_blakely](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@si\_blakely](https://boards.straightdope.com/u/si_blakely)\
**Post date:** [December 17, 2010, 11:03pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/17 "2010-12-17T23:03:31Z")

</div>

> [@Stoid](#):
>
> and is there any way to know if yum is already there and ready to work or I have to learn how to install that first?

Try  
_yum list_ first, to check that it is working.  
Then try the command up above  
_yum install perl-DBI_

Anything you are not sure about, give us the output and I’ll take a look

Si

---

<div class="post-metadata">

**Author:** ![Digital\_Stimulus](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@Digital\_Stimulus](https://boards.straightdope.com/u/Digital_Stimulus)\
**Post date:** [December 17, 2010, 11:33pm UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/18 "2010-12-17T23:33:03Z")

</div>

> [@friedo](#):
>
> You’ve gotten good free advice (use your system’s package manager) but you haven’t followed it.

Indeed. If you ( **Stoid** ) are using CentOS, it took me a few seconds with google to find that not only is _yum_ standard with every CentOS install, there’s also a GUI extension, _yumex_, available. CentOS documentation for _yumex_ is found [here](http://www.centos.org/docs/4/html/yumex/).

---

<div class="post-metadata">

**Author:** ![Arnold\_Winkelried](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@Arnold\_Winkelried](https://boards.straightdope.com/u/Arnold_Winkelried)\
**Post date:** [December 18, 2010, 12:18am UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/19 "2010-12-18T00:18:04Z")

</div>

> [@Stoid](#):
>
> Is there a good resource for baseline understanding of using yum that has the decency to treat me like the completely clueless noob that I am?

I think part of the problem is, you are trying to do things that one wouldn’t expect a completely clueless noob to be doing, so there may not be a tutorial written for your level. I would try to find a friend or someone who understands UNIX better and have them help you. It will end up being much easier and going much faster than you trying to get help online.  
There are some things I tell people to not even attempt to try by themselves, because it will take too much of their time than it’s worth. This might be one of them.

---

<div class="post-metadata">

**Author:** ![Kyrie\_Eleison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kyrie_eleison/32/7682_2.png) [@Kyrie\_Eleison](https://boards.straightdope.com/u/Kyrie_Eleison)\
**Post date:** [December 18, 2010, 1:02am UTC](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502/20 "2010-12-18T01:02:56Z")

</div>

> [@Stoid](#):
>
> And I’m pretty sure that the DBD drivers part isn’t on me, that will be handled by the script.

You’re going to have to worry about this - it is most likely on you. The DBD components are specific to the database systems with which you want to use the more general DBI interface. At some point, you will need to choose which systems you want to interface with and install the correct DBD modules. I don’t recall if any DBD drivers come with DBI by default; you may get lucky and get covered there, but I think most likely not.

You’ve been given good advice in this thread – use yum if you can, the CPAN module as a second choice, and the manual installation path that you’re currently pursuing should be your last choice.

[Next page](https://boards.straightdope.com/t/installling-perl-module-dbi-on-linux-centos-head-exploding/564502.md?page=2)
