查找安装包

macOS系统会有很多安装包,如果要找一个安装包,只知道大概的名称,不太确定一个安装包的包标识符,只通过安装包列表找比较困难费事而且容易漏掉。我们下面只介绍一种使用Shell命令的方法。比如:我们要找有关Gatekeeper的所有安装包,运行下面命令,会列出已安装的不同版本:

$ pkgutil --pkgs | grep Gatekeeper com.apple.pkg.GatekeeperConfigData.16U1300 com.apple.pkg.GatekeeperConfigData.14U2302 com.apple.pkg.GatekeeperConfigData.14U2298 com.apple.pkg.GatekeeperConfigData.16U1259 com.apple.pkg.GatekeeperConfigData.16U1265 com.apple.pkg.GatekeeperConfigData.16U1168 com.apple.pkg.GatekeeperConfigData.14U2297 com.apple.pkg.GatekeeperConfigData.16U1295 com.apple.pkg.GatekeeperConfigData.16U1325

上面使用了grep命令来从命令(pkgutil --pkgs)的输出中筛选我们需要的关键字( Gatekeeper)并显示。

Last updated