在MacPorts中,如何识别和卸载未使用的库端口?
macports 中的许多端口作为其他(应用程序)端口的库依赖项安装,但卸载这些应用程序端口并不会卸载相应的库依赖项。随着时间的推移,许多这样的图书馆端口变成了孤儿,浪费了空间。所以我想知道是否有办法找到它们。
谢谢。
Lots of ports in macports are installed as library dependencies of the other (application) ports, but uninstall those application ports doesn't uninstall corresponding library dependencies. As time goes by, lots of such library ports become orphon and is just a waste of space. So I wonder if there is a way to find them out.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要删除非活动端口,您可以运行
sudo port uninstall inactive
要从 2.4 及更高版本中删除,您可以运行
sudo port reclaim
To remove inactive port you can run
sudo port uninstall inactive
To remove from version 2.4 and upper you can run
sudo port reclaim
您需要一个名为 port_cutleaves 的包/脚本。
我认为它可以直接从 macports 或 fink 获得。
无论哪种方式,你的问题都是孤立的依赖项,这应该删除它们,抱歉,我没有使用详细信息,因为我没有安装 macports。
更新:此链接可能对您有帮助,它是一个备忘单。
http://www.jbmurphy.com/2011/ 02/17/my-mac-ports-cheat-sheet/
There is a package/script you need called port_cutleaves.
I think it's available directly from macports or fink.
Either way your problem is orphaned dependencies, and this should remove them, sorry I don't have details of usage as I'm away from my macports install.
Update: This link might help you, it's a cheat sheet.
http://www.jbmurphy.com/2011/02/17/my-mac-ports-cheat-sheet/
安装新版本的 ports 后,旧版本将更改为非活动状态,但仍保留在磁盘上。要查看这些端口:
port list inactive
要删除所有不活动端口:
[[ -z "$(port -q list inactive)" ]] || sudo port uninstall inactive
这不会删除任何端口的活动版本,包括仅在构建特定端口期间需要的端口。正如 @Mitchell Currie 提到的,如果您想删除这些活动端口,请使用
port_cutleaves
。As new versions of ports get installed, old versions are changed to an inactive state but remain on the disk. To see these ports:
port list inactive
To remove all inactive ports:
[[ -z "$(port -q list inactive)" ]] || sudo port uninstall inactive
This does not remove active versions of any port, including ports that were only needed during the build of a specific port. As @Mitchell Currie mentioned, use
port_cutleaves
if you want to remove those active ports.