Chinaunix

标题: How to uninstall Perl module? [打印本页]

作者: hgneng    时间: 2007-02-14 16:26
标题: How to uninstall Perl module?
在CPAN下了几个模块
make install
装在了/usr/local/lib/perl/
make uninstall
均出现
Uninstall is unsafe and deprecated, the uninstallation was not performed.
We will show what would have been done.

no packlist file found:  at /usr/share/perl/5.8/ExtUtils/Install.pm line 318.
make: *** [uninstall_from_sitedirs] 错误 2

请问Perl的模块怎样卸载呢?
作者: 兰花仙子    时间: 2007-02-14 21:44
原帖由 hgneng 于 2007-2-14 16:26 发表
在CPAN下了几个模块
make install
装在了/usr/local/lib/perl/
make uninstall
均出现

请问Perl的模块怎样卸载呢?


find / -name "modulename.pm" -exec rm -f {} \;

直接find到后删掉算了.
作者: hgneng    时间: 2007-02-15 18:44
这个操作比较危险,而且不够干净,因为Perl中有日志记录安装了什么模块,并且auto目录下也可能有模块的文件。我觉得Perl不可能不提供卸载的方法呀……
作者: ulmer    时间: 2007-02-15 19:15
原帖由 hgneng 于 2007-2-15 18:44 发表
这个操作比较危险,而且不够干净,因为Perl中有日志记录安装了什么模块,并且auto目录下也可能有模块的文件。我觉得Perl不可能不提供卸载的方法呀……


the safety way are:
- if you use some linux distribution such like redhead, debian,
  with *.rpm or *.deb installed perl module, then using rpm or dpkg
  tools to unistall them.

- if you have installed perl modules per make, then check the install log
  under .cpan
  current tool cpan has no feature for uninstall-

- if you use activePerl, it provides PPM remove method.

Otherwise there is no optimal method to uninstall perl modules.

--ulmer
作者: gsging    时间: 2007-02-17 09:49
原帖由 ulmer 于 2007-2-15 19:15 发表

current tool cpan has no feature for uninstall-


针对这一条,简单作个说明:
以Cache::Memcached在FB上的安装为例:
BSD上大部分Perl模块在ports里面都有,使用CPAN安装模块时候也会去ports的临时目录建立自己的目录.
$ cd /var/db/pkg/
会找到bsdpan-Cache-Memcached-1.18/目录.
/var/db/pkg/里面找到几乎所有使用CPAN安装过的模块.
进入到对应的目录,里面有个+CONTENTS文件,里面记录了该模块的安装路径以及文件列表.
  1. $ cat  +CONTENTS
  2. @comment PKG_FORMAT_REVISION:1.1
  3. @name bsdpan-Cache-Memcached-1.18
  4. @cwd /
  5. @comment This package was generated by BSDPAN
  6. /usr/local/lib/perl5/5.8.8/man/man3/Cache::Memcached.3
  7. @comment MD5:b903a23edcfd0b1a256b7bf308782783
  8. /usr/local/lib/perl5/site_perl/5.8.8/Cache/Memcached.pm
  9. @comment MD5:c9a5b30191f61147b9c635e886761042
  10. /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Cache/Memcached/.packlist
  11. @comment MD5:b923f57589dcf709b9da49905b8ec360
  12. @unexec rmdir /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Cache/Memcached 2>/dev/null || true
  13. @unexec rmdir /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/Cache 2>/dev/null || true
  14. @unexec rmdir /usr/local/lib/perl5/site_perl/5.8.8/Cache 2>/dev/null || true
复制代码


经过试验,其他在FB上使用cpan安装的模块同样适用.
作者: flw    时间: 2007-02-23 23:41
find / -name .packlist




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2