Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 8625  / 2 Years ago, thu, june 2, 2022, 5:12:09

I was attempting to upgrade my Perl modules through CPAN, but I did not supply a regex/module name to upgrade: perl -MCPAN -e 'upgrade'; I can only assume the worst (which seems to be supported by the output of perldoc perllocal), i.e. all Perl modules from CPAN are installing.



How can I undo this mess? I suppose I can remove /usr/local/share/perl, but what are the implications of that?



Edit: I still have 95% free space on my hard drive, so it's not a huge concern. I just don't want lots of unnecessary clutter. I'm considering rm'ing that directory, doing dpkg --purge perl and redoing the apt-get and CPAN install process. But is it really necessary, or can I just remove the unnecessary modules from /usr/local/share/perl?


More From » perl

 Answers
5

Looking at this a bit closer, I don't think that you need to or should delete any directories or files on your system.



Running the command perl -MCPAN -e 'upgrade' from the command line will not install additional modules onto your system.



It will only attempt to upgrade installed modules, through the CPAN package management system, and not through Synaptic.



This is similar to running the 'r' command and then running the upgrade command at the cpan[1]> prompt. See here.



CPAN and Synaptic are two separate and distinct package management systems.



This will not install all possible Perl modules from CPAN. Nor will it modify the existing system package dB. So, you can definitely roll this back safely.



However, this is still potentially risky if an application or your system depends upon a particular version of a Perl module.



If you have interrupted the upgrade process, chances are good that you have avoided harming your system.



Recovery options:



From a command line, start cpan, and run the command r to see the list of installed modules and available upgrades. For example, here is the abbreviated output from my cpan:



cpan[7]> r

Package namespace installed latest in CPAN file
App::Cpan 1.5701 1.61 BDFOY/App-Cpan-1.61.tar.gz
DBD::mysql 4.020 4.022 CAPTTOFU/DBD-mysql-4.022.tar.gz
DBI 1.616 1.623 TIMB/DBI-1.623.tar.gz
DB_File 1.821 1.827 PMQS/DB_File-1.827.tar.gz
Error 0.17010 0.17019 SHLOMIF/Error-0.17019.tar.gz
Eval::Closure 0.06 0.08 DOY/Eval-Closure-0.08.tar.gz
....


Take the Eval::Closure module, for this example. Let's say that you let the perl -MCPAN -e 'upgrade' command complete and you now have version 0.08 installed.



Looking at Synaptic, in this case, it will show that the latest version in the repository will still be 0.06(0.06-1, specifically, in my instance).



You can roll back to your system version, by running the following command:



sudo apt-get install --reinstall libeval-closure-perl



If you have installed any Perl modules manually and want to roll them back to a previous version, you will need download them again (either from source.cpan.org or elsewhere), and manually re-install them.



To summarize: Upgrading Perl modules within CPAN should not affect your system repository.



Best of luck. Don't panic.


[#32326] Friday, June 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
strhen

Total Points: 27
Total Questions: 111
Total Answers: 103

Location: Angola
Member since Tue, Apr 25, 2023
1 Year ago
;