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.

2
  • 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). Commented Jun 16, 2014 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. Commented Jun 16, 2014 at 16:51

2 Answers 2

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.

2
  • 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. Commented Jun 16, 2014 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... Commented Jun 16, 2014 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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.