4

I installed some Perl modules in my Linux machine. If I enter perldoc perllocal it shows a list of Perl modules installed in my machine, but now I don't need those Perl modules, so I want to remove them.

Does anyone know how to uninstall or remove those modules installed in Linux (debian 2.6.26)?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Senthil kumar
  • 965
  • 3
  • 16
  • 33
  • 2
    *HOW* did you install the modules? Did you use CPAN or CPANPLUS, yum or apt or something similar? Did you download the modules and install them manually? – the Tin Man Nov 26 '10 at 05:35
  • I downloaded the needed modules from CPAN and installed it by, perl Makefile.PL, make, make test and make install commands. – Senthil kumar Nov 26 '10 at 06:23
  • Related: http://stackoverflow.com/questions/4045917/remove-perl-modules-from-cpan-on-mac – Ether Nov 26 '10 at 17:05
  • The new hipness is pm-uninstall: http://search.cpan.org/dist/App-pmuninstall/ – Tempire Feb 28 '12 at 19:08

6 Answers6

6

The Perl installers are just that... installers. They don't verify that they're not overwriting existing files, and they don't record precisely what they install. Therefore, they cannot uninstall. If you want a proper packaging system, you can't use the Perl installers.

Randal Schwartz
  • 39,428
  • 4
  • 43
  • 70
  • What a radical thing to say. Of the >1300 distributions I have installed, only a handful are not cleanly reversible with the [primary recording mechanism](http://p3rl.org/ExtUtils::Packlist). – daxim Nov 26 '10 at 15:12
  • How is "the truth" radical? From the beginning, the Perl installers were never meant as uninstallers. If you had been around since the beginning, you would know that. Just because it *mostly* works with simple distros doesn't mean you should be able to count on it for *every* distro like a proper packaging system. – Randal Schwartz Dec 25 '10 at 00:44
5

If you use CPANPLUS to install a module, you can (at least in theory) also use it to uninstall it:

$ cpanp
...
> u Unwanted::Module
...
> q
$

The older CPAN module does not support an uninstall option. And, as Randal Schwartz notes, uninstalling modules is not always reliable.

Community
  • 1
  • 1
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
3

Use cpanp (its uninstall is not limited to cpanplus-installed modules), or see ExtUtils::Packlist's modrm example.

Uninstall tools have historically been not readily provided because the install process is not robustly reversible, as Randal cautions.

ysth
  • 96,171
  • 6
  • 121
  • 214
  • An uninstall tool similar to `modrm` was readily provided in the [CPAN FAQ](http://web.archive.org/web/20070710130823/www.cpan.org/misc/cpan-faq.html#How_delete_Perl_modules) until it got "depublished" for some bullshit reason. – daxim Nov 26 '10 at 15:03
  • You can't just sprinkle magic fairy dust on something that doesn't work to make it work. Fundamentally, there is no registration of path names, so any two modules in the CPAN can easily install to the same place, and some even do. – Randal Schwartz Dec 25 '10 at 00:45
2

As I've mentioned somewhere else on SO, my answer is to just leave them. There are VERY few Perl modules large enough to take up any actual space on you system. I'm not saying don't try if you really need the space, but if you don't ... its not worth it.

Community
  • 1
  • 1
Joel Berger
  • 20,180
  • 5
  • 49
  • 104
1

You can try App::pmuninstall

DESCRIPTION

App::pmuninstall is a fast module uninstaller. delete files from .packlist.

App::cpanminus and, App::cpanoutdated with a high affinity.

bor
  • 181
  • 1
  • 6
0

I tried cpanp uninstall and it didn't work for me. I did find success using App::pmuninstall.

pm-uninstall [options] Module ...

pm-uninstall - Uninstall modules - metacpan.org

Dave Horner
  • 405
  • 5
  • 10