Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl: the Markov chain saw
 
PerlMonks  

upgrade broke perl?

by eppo (Novice)
on Jan 30, 2013 at 18:48 UTC ( #1016135=perlquestion: print w/ replies, xml ) Need Help??
eppo has asked for the wisdom of the Perl Monks concerning the following question:

I have an ubuntu 10.04 server. the other day i attempted to upgrade perl using perl -MCPAN -e 'upgrade'. in the end it failed. today, i tried to do a do-release-upgrade, which failed due to some perl errors. right now even if i try to do the perl upgrade again, i am getting the following errors:

Can't locate feature.pm in @INC (@INC contains: /usr/share/perl/5.14.2 + /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /u +sr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 + /usr/local/lib/site_perl /opt) at /usr/local/share/perl/5.10.1/Text/ +Tabs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. Compilation failed in require at /usr/local/share/perl/5.10.1/Text/Wra +p.pm line 35. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Wrap.pm line 35. Compilation failed in require at /usr/share/perl/5.14.2//CPAN.pm line +58. BEGIN failed--compilation aborted at /usr/share/perl/5.14.2//CPAN.pm l +ine 58. Compilation failed in require. BEGIN failed--compilation aborted.

Could someone please help me fix this? is there a way to downgrade back to 5.10.1? or force an ubuntu reinstall of 5.10.1? your help will be much appreciated. Thanks Joe

Comment on upgrade broke perl?
Download Code
Re: upgrade broke perl?
by scorpio17 (Monsignor) on Jan 30, 2013 at 19:22 UTC

    I'd suggest using the Ubuntu package manager.
    Type this at the command line:

    sudo apt-get update && sudo apt-get install perl

      It sounds like eppo has broken the perl install on his system too much for that to work.

      As others have said, it is usualy not a good idea to modify the system perl install. This applies double on Debian derived distros such as Ubuntu, because the system package manager uses perl internaly, so if you break perl you are likey to break the whole system to the point that it is impossible to re-install perl (or anything else), forcing you to re-instal the whole system to get it working again.

Re: upgrade broke perl?
by eppo (Novice) on Jan 30, 2013 at 19:31 UTC

    when I try to update ubuntu, it tells me that i have unmet dependencies, and to run apt-get -f install, when i do that, i get this:

    debconf: Perl may be unconfigured (Can't locate feature.pm in @INC (@I +NC contains: /usr/share/perl/5.14.2/ /etc/perl /usr/local/lib/perl/5. +10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /us +r/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at / +usr/local/share/perl/5.10.1/Text/Tabs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. Compilation failed in require at /usr/local/share/perl/5.10.1/Text/Wra +p.pm line 35. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Wrap.pm line 35. Compilation failed in require at /usr/share/perl5/Debconf/Template.pm +line 10. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template +.pm line 10. Compilation failed in require at /usr/share/perl5/Debconf/Question.pm +line 8. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question +.pm line 8. Compilation failed in require at /usr/share/perl5/Debconf/Config.pm li +ne 7. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Config.p +m line 7. Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line +10. Compilation failed in require at (eval 1) line 4. BEGIN failed--compilation aborted at (eval 1) line 4. ) -- aborting Setting up libpam0g (1.1.3-7ubuntu2) ... Can't locate feature.pm in @INC (@INC contains: /usr/share/perl/5.14.2 +/ /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 / +usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.1 +0 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.1/Text/Ta +bs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Tabs.pm line 15. Compilation failed in require at /usr/local/share/perl/5.10.1/Text/Wra +p.pm line 35. BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/Text +/Wrap.pm line 35. Compilation failed in require at /usr/share/perl5/Debconf/Template.pm +line 10. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Template +.pm line 10. Compilation failed in require at /usr/share/perl5/Debconf/Question.pm +line 8. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Question +.pm line 8. Compilation failed in require at /usr/share/perl5/Debconf/Config.pm li +ne 7. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Config.p +m line 7. Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line +10. Compilation failed in require at /usr/share/perl5/Debconf/Db.pm line 7 +. BEGIN failed--compilation aborted at /usr/share/perl5/Debconf/Db.pm li +ne 7. Compilation failed in require at /usr/share/debconf/frontend line 6. BEGIN failed--compilation aborted at /usr/share/debconf/frontend line +6. dpkg: error processing libpam0g (--configure): subprocess installed post-installation script returned error exit sta +tus 2 Errors were encountered while processing: libpam0g E: Sub-process /usr/bin/dpkg returned an error code (1)
    any idea on how to fix this? thanks for your help. Joe
Re: upgrade broke perl?
by tobias_hofer (Friar) on Jan 30, 2013 at 19:51 UTC
    Hello Joe,

    IMHO it seems that the Perl includepath @INC contains mixed paths of both perl libraries. The old 5.10.1 and the new 5.14.2.
    However, Perl is not able to resolve the dependency tho the module feature.pm, which must be located in some of the folders.
    Depending on what version you will get by typing perl -v on the shell, I would give a try doing following things to get the do-release-upgradeworking.
    Create a perl-file from which you will start the do-release-upgrade
    i.e. UpdateMe.pl.
    Depending on your perl version I would manipulate the @INC path accordingly.
    In case of Version 5.10.1 :
    We have to replace following paths in the @INC:
    /usr/share/perl/5.14.2/etc/perl by /usr/share/perl/5.10.1/etc/perl
    You can do this by simply manipulating the @INC. As the wrong entry is at the first place you can remove it by an shift operation and unshift the correct path.
    Like this:

    #adjusting the @INC shift(@INC); unshift(@INC,'/usr/share/perl/5.10.1/etc/perl'); #Call to your script qx(do-release-upgrade);

    In case your are running the perl 5.14.2, you got to replace all the other paths pointing to version 5.10.1. For this I would recommend some reg-expressions.
    Or to keep it simple you can redefine the @INC by
    @INC = ('/usr/share/perl/5.14.2','/etc/perl /usr/local/lib/perl/5.14.1 +','/usr/local/share/perl/5.14.2','/usr/lib/perl5','/usr/share/perl5', +'/usr/lib/perl/5.14','/usr/share/perl/5.14','/usr/local/lib/site_perl +','/opt');
    But first make sure that those folders exists at all.

    However, I am not sure if a do-release-upgrade is the correct answer to this issue - I have some doubts.

    I am no ubuntu expert, but it should be possible to reinstall perl as 'ubuntu package' or rpm or something like that.
    I guess this approach would fit more this Issue.
    In case that ubuntu install scripts are perl based you can use the approach above eitherway.


    I hope this helps.. :-)

    Best regards

    Tobias
Re: upgrade broke perl?
by aitap (Chaplain) on Jan 30, 2013 at 20:11 UTC

    Try cleaning up perl directories in /usr/local: ubuntu-packaged Perl is installed with /usr prefix, and CPAN is installing everything with /usr/local prefix by default, so you should get your system Perl back if you delete the modules installed in /usr/local/ (Perl searches for its data in /usr/local before /usr).

    By the way, if you want to install a newer Perl version, it might be better to use perlbrew or perlall.

    Edit: minor spelling corrections
    Sorry if my advice was wrong.

      Removing /usr/local/share/perl directory did the trick! Thank you so much for your help! upgrade to 12.04.1 went smoothly after that.

Re: upgrade broke perl?
by eppo (Novice) on Jan 30, 2013 at 20:18 UTC

    I removed the reference to the perl 5.14.2 in @INC, and i'm still getting the same errors. the file feature.pm does not exist on my system. is there a way to install it without using cpan?

      IMHO you can still download the package manually from cpan and do an installation by hand.
      http://search.cpan.org/~rgarcia/perl-5.9.3/lib/feature.p
      But as Jason L. Froebe already mentioned it might be a better idea to leave system perl as it is and use Perlbrew instead


      Best regards
      Tobias
Re: upgrade broke perl?
by jfroebe (Vicar) on Jan 30, 2013 at 20:24 UTC

    IMHO Unless you really need to modify the system Perl installation, I would recommend using Perl Brew instead.

    Jason L. Froebe

    Blog, Tech Blog

Re: upgrade broke perl?
by Argel (Prior) on Jan 31, 2013 at 19:42 UTC
    So as a post-mortem of sorts, what possessed you to upgrade the OS installed Perl? It seems like a blind spot that even veteran system engineers and system administrators fall pray to, so I'm always a bit curious when things like this happen.

    FWIW, as a general rule it's best to leave what the OS ships with alone as much as possible. Sorry you had to find that out the hard way. :/

    Elda Taluta; Sarks Sark; Ark Arks
    My deviantART gallery

      You're just some end user that doesn't understand security by any shape or means right? Not someone that runs something high profile... This is the exact crap that the high level companies getting hacked seem to run by, then wonder why people are slightly annoyed when they lose 70million customer details rfom their db including unsalted passwords and credit card details...
        Nonsense -- when you upgrade, be ready to roll back any updates that break your stuff -- or be ready to fix your broken stuff -- if you're not ready for rollback or fixing, then an upgrade doesn't get you anything
Re: upgrade broke perl?
by JoseSA (Initiate) on Jul 02, 2013 at 16:11 UTC
    I had a similar problem and followed a different path: in my virtual Mint 15 I installed a new perl (5.14.4) over the native perl 5.14.2 and apt-get started throwing errors, mainly...
    ...dont't find ... Debconf/Db.pm in @INC ...

    So @INC has lost the directory which holds that pm, but it (and other pms) were still in the system.

    Solution: find Db.pm
    find . -name Db.pm -print
    >>>/usr/share/perl5/Debconf/Db.pm

    Then I go to one of the dirs in current @INC and create a symlink
    cd /usr/lib/perl5/site_perl/5.14.4/
    ln -s /usr/share/perl5/Debconf Debconf

    'et voila', I managed to upgrade flawlessly, apt-get is working
    apt-get update
    apt-get upgrade

    Don't know if it would work if both perl major versions were different (here is 5.14 for both).
Re: upgrade broke perl?
by thecurio (Initiate) on Oct 11, 2013 at 15:24 UTC
    I had the same issue whilst upgrading Debian Squeeze to Wheezy. What worked for me was to simply copy /usr/share/perl/5.10.1/feature.pm from another Squeeze system to the same location on the problem system. A bit of a hack, but it got me past the broken upgrade.
Re: upgrade broke perl?
by vsespb (Hermit) on Oct 14, 2013 at 12:15 UTC
    That's a bit not related, but imho, do-release-upgrade in 10.04 is totaly broken, so it not worth fixing perl
    I tried it on just-installed brand new ubuntu 10.04 desktop - it failed. (however it worked fine when I logged out from GUI - still a bug, I did not receive any notice that I must shutdown GUI)
    I tried it on my real 10.04 (without GUI), and of course I ended up with complete reinstall (I've got lots of funny messages - like "unknown version Ubuntu 12.04", "wrong GCC version", "cannot compile kernel", "there were some errors - exit or continue")
    Perhaps for server distribution it works better, but for GUI it just don't work unless you did not touch anything (did not edit configs, did not workaround bugs, did not install software from source, etc) in the system after install

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1016135]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-04-20 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls