portmaster把ports分成四类:
- Root ports (不依赖其他的ports,也不被依赖)
- Trunk ports (不依赖其他的ports,但是被其他的ports依赖)
- Branch ports (依赖于其他的ports,同时也被依赖)
- Leaf ports (依赖于其他的ports,但不被依赖,所以可以清除)
root@ywops:~ # portmaster -l
===>>> Root ports (No dependencies, not depended on)
===>>> pkg-1.14.4_1
===>>> portmaster-3.19_25
===>>> 2 root ports
===>>> Trunk ports (No dependencies, are depended on)
===>>> indexinfo-0.3.1
===>>> 1 trunk ports
===>>> Branch ports (Have dependencies, are depended on)
===>>> gettext-runtime-0.20.2
===>>> libtextstyle-0.20.2
===>>> 2 branch ports
===>>> Leaf ports (Have dependencies, not depended on)
===>>> gettext-tools-0.20.2
===>>> 1 leaf ports
===>>> 6 total installed ports
查看软件包的依赖的相关命令
pkg info -r pkgname
#-r, --required-by Display the list of packages which require pkg-name
#portmaster列出所有安装的ports
portmaster -l
#-L list all installed ports by category, and search for updates
#-l list all installed ports by category
可以安装rmleaf工具清理leaf ports
cd /usr/ports/ports-mgmt/pkg-rmleaf/; make install clean ;rehash
或者
pkg install pkg-rmleaf
pkg-rmleaf
#pkg-rmleaf 会列出root ports和leaf ports
也可以使用以下两个命令
pkg delete pkgname
pkg autoremove #删除孤立软件包