如何一次卸载所有未使用的Macports软件包版本


32

维护macports软件包时,我更喜欢在用新软件包替换旧软件包时删除它们。但是,随着时间的推移,随着软件包的升级,您最终会遇到以下问题:

$ sudo port uninstall -f postgresql83
--->  The following versions of postgresql83 are currently installed:
--->    postgresql83 @8.3.3_0
--->    postgresql83 @8.3.7_0
--->    postgresql83 @8.3.8_1 (active)
Error: port uninstall failed: Registry error: Please specify the full version as recorded in the port registry.

是否有macports命令可一次删除软件包的所有版本?

Answers:


38

如果要卸载所有旧(非活动)版本,请尝试以下操作:

port -y -u uninstall
  # if you like what you see, change “port -y” to “sudo port”

如果您要卸载postgresql83端口的所有版本(非活动和活动),请尝试以下操作:

port -y uninstall installed and postgresql83
  # if you like what you see, change “port -y” to “sudo port”

这对我有用,但是太糟糕的端口无法自动处理对postgres84的依赖项更新。
— Dana the Sane,

2
@Dana the Sane如果您要自动删除依赖于postgres84的软件包,则可以使用--follow-dependents参数。
— 尼克,

@Nick我下次尝试卸载时会尝试。
— 桑达纳

第二种方法对我来说很好用,但是第一种方法-u似乎对安装多个版本发出了相同的警告,好像我根本没有使用-u过
— matt b

这些命令不起作用(在Mac OSX Mavericks上)。
— bzero

44
sudo port uninstall inactive

这将删除您的非活动端口。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.