3

Is there a way to completely remove CPAN from my machine? I tried searching Google for a way to do this, but all of the results are focused around uninstalling the modules.

norway-firemen
  • 143
  • 1
  • 4
  • 1
    CPAN is a Perl module and is always included with Perl. Ususally CPAN is a HUGE blessing when it comes to using Perl. Why do you want to remove it? (I ask because there might be a nicer way to achieve your goals without ripping the guts out of Perl). – Eirik Toft Jun 16 '14 at 16:15
  • I'm playing around with some server automation stuff. I'm checking to see if my configurations are actually working and properly installing CPAN. In order to do that, I'd like to remove CPAN. – norway-firemen Jun 16 '14 at 16:51

2 Answers2

1

A quick check of RHEL5 based boxes indicates that CPAN is provided as a part of the base Perl package. So there really isn't a way to remove it outside of yanking all of Perl itself. I'm betting it's the same with CentOS6. You can verify it yourself with:

rpm -q --whatprovides $(which cpan)

So you'll probably want to find a better test for your automation software.

Christopher Karel
  • 6,442
  • 1
  • 26
  • 34
  • That's what I'm afraid of. `rpm -q --whatprovides $(which cpan)` yields `file /usr/local/bin/cpan is not owned by any package`. I feel that this is an appropriate answer. – norway-firemen Jun 16 '14 at 18:53
  • That would indicate you probably compiled Perl/CPAN from source, or otherwise installed it outside of a proper package manager. So you could probably do a `make uninstall` to get rid of it. Although you might find it easiest to use the proper CentOS repositories... – Christopher Karel Jun 16 '14 at 20:07
0

Your best bet is to remove the CPAN directory and CPAN.pm from whatever your Perl library directories are. Just run "perl -V", and check the directories listed as library paths. In one of those you will find a CPAN.pm and CPAN directory - make a backup of them and them remove them.

Eirik Toft
  • 834
  • 8
  • 20