如何一次卸载所有未使用的 macports 包版本

Dan*_*ane 33 macports macos

在维护 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.
Run Code Online (Sandbox Code Playgroud)

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

小智 44

sudo port uninstall inactive
Run Code Online (Sandbox Code Playgroud)

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


Chr*_*sen 39

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

port -y -u uninstall
  # if you like what you see, change “port -y” to “sudo port”
Run Code Online (Sandbox Code Playgroud)

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

port -y uninstall installed and postgresql83
  # if you like what you see, change “port -y” to “sudo port”
Run Code Online (Sandbox Code Playgroud)

  • @Dana the Sane 如果您的意思是自动删除依赖于 postgres84 的包,您可以使用 --follow-dependents 参数。 (2认同)