Why should I not update all my CPAN modules?

  • A+
Category:Languages

I thought it would be a good idea in general to update all software on my computer regularly. Since CPAN modules are not managed by my package manager I figured I should do cpan -u every once in a while. It was only after executing this that I read the man page note on this:

-u  Upgrade all installed modules. Blindly doing this can really break    things, so keep a backup. 
  1. Why should this break anything? And how should I keep my CPAN modules up to date otherwise; do I need to keep track of all manually installed modules (cpan doesn't seem to do this) and only update those regularly? How about the dependencies of my manually installed modules?
  2. Why did cpan -u upgrade stuff for ~15min even though I haven't installed a single CPAN module?
  3. Can I revert the cpan -u? Is it enough to delete ~/.cpan for this?

 


Why should this break anything?

It shouldn't, but complex systems are complex and sometimes things do break (e.g. if a module is updated with a non-backwards compatible change, or depends on a C library which has bugs which only show up in combination with specific dependencies).

And how should I keep my CPAN modules up to date otherwise;

Just keep backups in case things break.

Why did cpan -u upgrade stuff for ~15min even though I haven't installed a single CPAN module?

Perl is distributed with a large collection of modules, and other modules may have been installed by your distribution.

Can I revert the cpan -u?

You can overwrite it with the backup that the documentation recommended you take.

Is it enough to delete ~/.cpan for this?

No. That directory is used by the installer tool to cache data about available modules, to store source code, and to hold build artefacts. The installed files are written to your lib like any other library.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: