Installling Perl Module DBI on Linux CentOS - Head exploding

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, 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:

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.

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:”)

First, try the CPAN shell approach as documented here


perl -MCPAN -e 'shell'

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

then


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

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

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

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…”

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.

-V, not -v.

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

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.

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

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

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

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?

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?

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.

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

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

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

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.

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.

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.