Linux – How to fix broken apt/perl libraries

aptdebiandpkglinuxperl

I've got a Raspberry Pi set up as a web server, everything all working well until 5 mins ago, and I seem to have messed up man-db, apt or some perl library. apt-get doesn't seem to be updating and installing applications properly due to some load error:

harry@raspberrypi ~ $ sudo apt-get upgrade

The following packages will be upgraded:

pypy-upstream raspi-config scratch

Fetched 40.4 MB in 37s (1088 kB/s)

/usr/bin/perl: error while loading shared libraries: /usr/lib/libperl.so.5.14: n onzero padding in e_ident

Setting up man-db (2.6.2-1) …

/usr/bin/perl: error while loading shared libraries: /usr/lib/libperl.so.5.14: n onzero padding in e_ident

dpkg: error processing man-db (–configure):

Errors were encountered while processing:
man-db

subprocess installed post-installation script returned error exit status 127

E: Sub-process /usr/bin/dpkg returned an error code (1)

Full pastebin here: http://pastebin.com/LYKQ5Xde

I tried 'sudo dpkg-reconfigure -phigh -a' as suggested on a forum somewhere and got this same perl error:

/usr/bin/perl: error while loading shared libraries: /usr/lib/libperl.so.5.14: nonzero padding in e_ident

Any help is greatly appreciated, thanks!

Best Answer

Try to reinstall the package containing libperl.so.5.14. That package is "perl-base". Try

apt-get --reinstall install perl-base

If this also fails, you can try to reinstall the package file (perl-base_5.14....deb). You can download it from the mirror manually or it might even still be cached from the last upgrade in /var/cache/apt/archives. Install it by

dpkg -i perl-base_5.14..whatever..deb

Oh and just a note: You can find out yourself which package a file belongs to:

$ dpkg -S libperl.so.5.14
perl-base: /usr/lib/libperl.so.5.14.2
perl-base: /usr/lib/libperl.so.5.14
Related Question