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
?
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:Take the
Eval::Closure
module, for this example. Let's say that you let theperl -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.
I would recommend doing:
apt-get remove <installed-packages> && apt-get autoremove
(to remove dependencies)&& apt-get purge <installed-packages>
(to remove config files remaning) then you can remove the folders that you don't need, but it should already be done for you :)