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

I have an odd problem in teh configuration of my ubuntu system that seems to stem from a perl configuration issue. It is kind of basic but I don't find any clues by google and so on.

When I try to run tools like debconf, I get :

Can't locate Debconf/Db.pm in @INC ... and the listing of @INC, which is all dirs under /usr/local/lib/perl5

By searching, I see that this module is there - it's under /usr/share/perl5

Now I do recall that a long while back, I built perl from scratch. I guess that I screwed some of the configuration up? What do I do to reinstall the missing stuff? Do I have to recompile? I've tried "cpan Debconf/Db" but it doesn't actually seem to be a CPAN module. Can I somehow just add /usr/share/perl5 ... into @INC? Where do I even find documentation for this kind of issue?

Replies are listed 'Best First'.
Re: perl configuration problem
by Corion (Patriarch) on Jun 16, 2007 at 21:31 UTC

    I had this problem once and it was because I upgraded the system Perl with a newer version (it was Debian, but I guess that Ubuntu relies on these parts of Debian). The basic moral of the story is, don't mess with the system Perl. Perl offers you to install itself at /usr/bin/perl or /usr/local/bin/perl, and if you accept that, it will overwrite the Debian version of Perl, which is unfortunately needed for debconf and apt-get.

    If you're lucky, you can maybe reinstall the Debian Perl package over your Perl, or fiddle with symlinks to make your new Perl see the other Debian-owned Perl modules.

    In my case, I reinstalled the system and resolved to always compile my own Perl versions to live under /opt/perl instead.

      wow. thanks. I didn't realise that deb/ubuntu were that sensitive, though it makes sense. I'll see if I can fix it, if not maybe it's maybe time to upgrade to Ubuntu 7.xx ... ouch.
        Upgrading while your system is broken is really not a good idea.

        Try a aptitude reinstall perl perl-base perl-modules.

        Greetings from the DebConf ;-)