I have an raspberry-pi already installed and configured for a local application and I need to install other things on. Whatever I try to install, I get the following error:
(Can't find string terminator '"' anywhere before EOF at /usr/share/perl/5.20/warnings.pm line 355.
Compilation failed in require at /usr/share/perl/5.20/Carp.pm line 5.
BEGIN failed--compilation aborted at /usr/share/perl/5.20/Carp.pm line 5.
Compilation failed in require at /usr/lib/arm-linux-gnueabihf/perl/5.20/IO/File.pm line 8.
BEGIN failed--compilation aborted at /usr/lib/arm-linux-gnueabihf/perl/5.20/IO/File.pm line 8.
Compilation failed in require at /usr/share/perl/5.20/FileHandle.pm line 9.
It seems that some perl files are corrupted or something. I tried reinstalling perl and I also runned
sudo dpkg-reconfigure perl
sudo apt-get --reinstall install perl-base
But I get the same error with string terminator in /usr/share/perl/5.20/warnings.pm line 355. Bellow is the code from warnings.pm at the line 355(the last line from file)
Croaker("package '$category' not registered for
NUL NUL NUL NUL NUL
and so on. Any help it will be much apreciated. If you need some command outputs just ask. Thanks!
What I did to solve the problem and to reinstall the perl and perl-base without reinstalling the os:
I go to /var/cache/apt/archives where I found perl-base_5.20.2-3+deb8u6_armhf.deb and perl_5.20.2-3+deb8u6_armhf.deb then I reinstall them using
sudo dpkg -i perl-base_5.20.2-3+deb8u6_armhf.deb
sudo dpkg -i perl_5.20.2-3+deb8u6_armhf.deb
Pay attention that your versions can be different. If they are not cached you can download them from the mirror manually. Hope it will help someone.