Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

upgrade broke perl?

by eppo (Initiate)
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 (Prior) 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 (Initiate) 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 (Scribe) 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 (Initiate) 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

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 chanting in the Monastery: (10)
As of 2013-05-23 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (473 votes), past polls