LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1185|回复: 6

发现个好东西──又一清理系统的工具

[复制链接]
发表于 2005-12-24 16:37:31 | 显示全部楼层 |阅读模式
由第三方写的一个脚本,用来清除多余的(不被依赖的、陈旧的、不必需的)包,也可以用来
整理 world 文件,使之更干净。我试了一下,感觉很不错。

[color="Red"]使用前必须明白你正在做什么、其后果以及应对措施,否则损失自负

原出处: http://forums.gentoo.org/viewtopic-t-142475.html
下载地址: http://catmur.co.uk/~ed/main/my-bin/dep
本地下载:见[color="Blue"]附件(下载后去除txt扩展名)
________________________________________________________________

[color="Blue"]Edit: this script also now contains an "emerge depclean" that actually works, an "emerge prune" that actually looks at your dependencies, and a "qpkg -q" that isn't horribly broken!

A world file (/var/cache/edb/world) with lots of entries is no good for keeping your system clean and running smooth. Of course you need to go through it now and again to remove apps you don't want, but the job's easier if it contains as few 'extra' packages as possible i.e. packages that are actually deps on other packages.

Download: http://catmur.co.uk/~ed/main/my-bin/dep

dep v. 0.3.00 "Level Of Incompetence"
an inappropriate Portage engine!

Usage: dep [OPTION]... [PACKAGE]...
List dependencies and reverse dependencies of packages, and clean the world
file and the set of installed packages.

Task selection:
-h, -?, --help Display this help
-P, --purge Unmerge unneeded SLOTted packages
-d, --depclean Unmerge all unneeded packages
-l, --list-depends (default) List dependencies of PACKAGE
-L, --list-raw-depends Display the dependency strings for PACKAGE
-r, --list-rev-depends List reverse dependencies of PACKAGE
-w, --pruneworld Remove redundant entries from the world file

Options:
-b, --no-build-time Omit dependencies needed solely to build PACKAGE
-o, --original-depends Calculate dependencies as when PACKAGE was merged
-a, --ask (default) For -[Pdw]: ask to perform action
-f, --force For -[Pdw]: perform action without asking
-p, --pretend For -[Pdw]: show what action would be taken

A package is unneeded if there is no installed package that depends on it.
An entry in the world file is redundant if there is another installed package
that depends on it.
When merging the new world file, the merging program used is sdiff(1).
Your world file is located at /var/lib/portage/world.



And here's some sample output:

  1. # dep -w
  2. !!!REDUNDANT!!! app-admin/gkrellm depended on by:
  3.         x11-plugins/gkrellflynn-0.6
  4.         x11-plugins/gkrellmoon-0.6
  5.         x11-plugins/gkrellmss-2.3
  6. app-admin/syslog-ng
  7. !!!REDUNDANT!!! app-editors/gvim depended on by:
  8.         app-text/vim-latex-1.5_rc1
  9.         app-vim/info-1.7-r1
  10. app-editors/nano
  11. app-emulation/wine
  12. ...
  13. x11-themes/mplayer-skins
  14. x11-themes/nautilus-themes

  15. 145 packages in worldfile: 137 valid, 8 redundant; 70 packages in system.
  16. 563 packages installed: 12% in system, 25% in world, 63% deps.
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2005-12-26 09:29:09 | 显示全部楼层
Please paste it as attachment on the forum, the website can't be accessed. :help
回复 支持 反对

使用道具 举报

发表于 2005-12-26 20:55:01 | 显示全部楼层
可以清理distfiles不?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-26 22:19:17 | 显示全部楼层
Post by gamedragon
Please paste it as attachment on the forum, the website can't be accessed. :help

现在补上了,在附件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-26 22:26:17 | 显示全部楼层
Post by Freesnake
可以清理distfiles不?

好像没这个功能,不过已经足够强大了。

清理distfiles我以前从官方论坛下的一个[color="Blue"]脚本,很好用,再贴一下

下载后去除txt扩展名,用root直接运行distclean, 输出将被删除的distfiles,但只有加 [color="Red"]--pretend 参数时才真正执行删除动作:

  1. ~ # distclean
  2. Determining available tarballs in /usr/portage/distfiles ...
  3. Determining stale versions ...
  4. *Pretend* mode, will only pretend to delete files.
  5. [color="Blue"]To actually delete the files, reinvoke with the [color="Red"]--nopretend [/color]parameter.[/color]

  6. Would delete: Python-2.3.5 in favour of Python-2.4.2
  7. Would delete: VMware-workstation-5.5.0-18463 in favour of VMware-workstation-5.5.1-19175
  8. Would delete: curl-7.15.0 in favour of curl-7.15.1
  9. Would delete: findutils-4.2.25 in favour of findutils-4.2.27
  10. Would delete: findutils-4.2.27 in favour of findutils-4.3.0
  11. Would delete: fontconfig-2.2.3 in favour of fontconfig-2.3.2
  12. Would delete: gtk+-2.8.8 in favour of gtk+-2.8.9
  13. Would delete: libtool-1.5.20 in favour of libtool-1.5.22
  14. Would delete: libxfcegui4-4.2.2 in favour of libxfcegui4-4.2.3
  15. Would delete: linux-2.6.13 in favour of linux-2.6.14
  16. Would delete: man-pages-2.15 in favour of man-pages-2.17
  17. Would delete: man-pages-2.17 in favour of man-pages-2.18
  18. Would delete: nano-1.3.10 in favour of nano-1.3.9
  19. Would delete: pango-1.10.1 in favour of pango-1.10.2
  20. Would delete: pax-utils-0.1.4 in favour of pax-utils-0.1.5
  21. Would delete: poppler-0.4.2 in favour of poppler-0.4.3
  22. Would delete: psmisc-21.8 in favour of psmisc-21.9
  23. Would delete: pycairo-0.9.0 in favour of pycairo-1.0.2
  24. Would delete: rxvt-unicode-5.8 in favour of rxvt-unicode-5.9
  25. Would delete: rxvt-unicode-5.9 in favour of rxvt-unicode-6.0
  26. Would delete: udev-073 in favour of udev-077
  27. Would delete: udev-077 in favour of udev-078
  28. Would delete: udev-078 in favour of udev-079
  29. Would delete: vte-0.11.15 in favour of vte-0.11.16
  30. Would delete: xffm-4.2.2 in favour of xffm-4.2.3
  31. Would delete: xterm-205 in favour of xterm-207

复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2005-12-27 09:28:25 | 显示全部楼层
Post by Lolita


清理distfiles我以前从官方论坛下的一个[color="Blue"]脚本,很好用,再贴一下

下载后去除txt扩展名,用root直接运行distclean, 输出将被删除的distfiles,但只有加 [color="Red"]--pretend 参数时才真正执行删除动作:


好家伙,清理了整整1个G的旧文档。
相当不错的脚本。谢谢分享。
回复 支持 反对

使用道具 举报

发表于 2005-12-29 20:54:07 | 显示全部楼层
"No stale distfiles have been detected on your system!"

dep不能用, 说有语法错误
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表