5

After installation of latest Bundle::CPAN, I realized that certain legacy code will not run in this latest version. I wish to remove (and not just unlink) this latest version and revert back to using the old version. How can I do that?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61
  • Should I be adding this topic to StackExchange instead? – SkypeMeSM Oct 13 '10 at 04:02
  • I think this topic is appropriate for stackoverflow. To the old version of what exactly do you want to roll back? Just Bundle::CPAN, the dependencies it installed, or did it actually install a new version of perl? – rafl Oct 13 '10 at 04:05
  • yes i want to revert it back to older version of perl (5.6), since installing Bundle::CPAN installed perl 5.8. – SkypeMeSM Oct 13 '10 at 04:55
  • Have you tried downloading the desired version from http://perl.org and simply installing it as normal? – Ether Oct 13 '10 at 05:42
  • Platform is Unix and OS is ubuntu. I installed it from within the perl CPAN shell.. – SkypeMeSM Oct 13 '10 at 06:25
  • possible duplicate of [How can I de-install a Perl module installed via `cpan`?](http://stackoverflow.com/questions/2626449/how-can-i-de-install-a-perl-module-installed-via-cpan) – brian d foy Oct 13 '10 at 15:49
  • Out of curiosity, what issues are you encountering between versions 5.6 and 5.8? – Ether Oct 13 '10 at 16:47

2 Answers2

4

Perl nor CPAN.pm have a way to go back to what you had before you installed later versions of modules. See How can I de-install a Perl module installed via cpan?.

Next time, however, you can fix this problem.

Here's what I recommend:

  • If you can figure out which modules are causing the problem, install those in separate directories and adjust @INC to use those directories. Do that until you figure out the module versions you need.

  • When you figure out the distributions you need, grab those from CPAN or BackPAN. Keep the distributions locally and set up your own MiniCPAN with just those distros. Since CPAN has as a design feature to track only the latest versions of any distribution, you want to make your local MiniCPAN pretend that the older distributions are the latest versions. That's why I created MyCPAN::App::DPAN. I write a bit about this in Manage multiple MiniCPANs, and version them

  • There's also Pinto and Stratopan, which serve like source control for your private CPAN-like repository. Rollback if you get something you don't like.

  • Once you get things fixed, put your Perl libraries into source control so you can always roll back an installation. See Manage your Perl modules with git.

  • Come up with an installation and testing policy where you don't disturb anything before you know that everything works. Part of that is testing new installations outside of your main Perl library directories. When you think you're satisfied, then you can install into those directories.

Community
  • 1
  • 1
brian d foy
  • 129,424
  • 31
  • 207
  • 592
  • Now there is also [pinto](https://metacpan.org/pod/Pinto) which is like a version control system for Perl modules. To get started, you still have to figure out what the "right" modules should be. But after that, Pinto is designed to automate all the work that brian described. There is also [Stratopan](https://stratopan.com) for doing all that in the cloud. Disclosure: I operate stratopan. – Jeffrey Ryan Thalhammer Apr 09 '14 at 09:00
-1

The easiest way is by visiting metacpan. Search for your module. In your case Bundle::CPAN.

You then have to select the relevant version of the module that you want to install by clicking on the arrow to the left of the module name: enter image description here

Once you click on the version you want from the drop-down you can then download it or just do for example:

cpanm http://cpan.metacpan.org/authors/id/A/AN/ANDK/Bundle-CPAN-1.861.tar.gz

Hope that helps

Hamster
  • 680
  • 7
  • 23