免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3725 | 回复: 5
打印 上一主题 下一主题

How to uninstall Perl module? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-14 16:26 |只看该作者 |倒序浏览
在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的模块怎样卸载呢?

论坛徽章:
0
2 [报告]
发表于 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到后删掉算了.

论坛徽章:
0
3 [报告]
发表于 2007-02-15 18:44 |只看该作者
这个操作比较危险,而且不够干净,因为Perl中有日志记录安装了什么模块,并且auto目录下也可能有模块的文件。我觉得Perl不可能不提供卸载的方法呀……

论坛徽章:
0
4 [报告]
发表于 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

论坛徽章:
0
5 [报告]
发表于 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安装的模块同样适用.

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
6 [报告]
发表于 2007-02-23 23:41 |只看该作者
find / -name .packlist
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP