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

Hello monks!
I have a problem using apt-get and I think it's because system perl is broken:

sudo dpkg -l | grep -v ^ii
iFR linux-image-2.6.32-24-generic 2.6.32-24.41 Linux kernel image for +version 2.6.32 on x86 iF man-db 2.5.7-2 on-line manual pager iF perl 5.10.1-8ubuntu2 Larry Wall's Practical Extraction and Report pF tzdata 2011g-0ubuntu0.10.04 time zone and daylight-saving time data iU tzdata-java 2011g-0ubuntu0.10.04 time zone and daylight-saving time + data for
which perl /usr/local/bin/perl
perl -v This is perl 5, version 12, subversion 1 (v5.12.1) built for x86_64-li +nux
sudo apt-get --reinstall perl E: Felaktig åtgärd perl

Unfourtunately in swedish. It says "bad action" or something similar.

So apparently system perl is broken in some way. Can I reinstall using dpkg? In that case, how do I do? Thank you.

Replies are listed 'Best First'.
Re: Installing perl using dpkg
by Corion (Patriarch) on Jul 05, 2011 at 09:31 UTC
Re: Installing perl using dpkg
by salva (Canon) on Jul 05, 2011 at 09:25 UTC
      Thanks! It yeilds an error report ending like this:
      /var/cache/apt/archives/linux-image-2.6.32-24-generic_2.6.32-24.43_amd +64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
Re: Installing perl using dpkg
by moritz (Cardinal) on Jul 05, 2011 at 09:31 UTC

    You can try some steps:

    first manipulate your PATH to not contain the custom perl

    PATH=/bin:/usr/bin:/sbin/:/usr/sbin

    then try again.

    Second, if aptitude doesn't work, use dpkg directly. Dowload the perl and perl-modules .deb packages directly from your mirror, and install them each with dpkg -i $package_filename

    If you get it fixed, remember not to touch your system perl at all - use App::perlbrew instead.

      Thanks! Changing my PATH didn't help. Can you direct me to instructions for downloading perl directly from my mirror it would be much appreciated.

        This is purely a Debian OS issue and not at all related to Perl. Go to http://packages.debian.org, find the packages and download/install them.

Re: Installing perl using dpkg
by chrestomanci (Priest) on Jul 05, 2011 at 20:02 UTC

    It is worth bearing in mind that perl is used internally by the apt packaging system in Debian and it's derivatives (eg Ubuntu), so if you manage to properly break perl on a Debian platform, you won't be able to re-install it within the packaging system. Instead you will have to copy files from a live CD or suchlike.