pkgutil --forget:错误“没有这样的文件或目录”


1

我收到路径错误。

$ pkgutil --forget com.apple.pkg.CLTools_Executables
Unknown error Error Domain=NSCocoaErrorDomain Code=4 "“com.apple.pkg.CLTools_Executables.bom” couldn’t be removed." UserInfo={NSFilePath=/var/db/receipts/com.apple.pkg.CLTools_Executables.bom, NSUserStringVariant=(
    Remove
), NSUnderlyingError=0x7fb0cdc0bd70 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}.
Forgot package 'com.apple.pkg.CLTools_Executables' on '/'.

我要丢弃的收据数据在/System/Library/Receipts/

$ ls /System/Library/Receipts/com.apple.pkg.CLTool*
/System/Library/Receipts/com.apple.pkg.CLTools_Executables.bom
/System/Library/Receipts/com.apple.pkg.CLTools_Executables.plist
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_OSX1012.bom
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_OSX1012.plist
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_macOS1013.bom
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_macOS1013.plist
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_macOSSDK.bom
/System/Library/Receipts/com.apple.pkg.CLTools_SDK_macOSSDK.plist

为什么要pkgutil查找物料清单(BOM)文件/var/db/receipts/

注意:我已经删除了该文件夹/Library/Developer/CommandLineTools

动机:从AppStore更新中删除已卸载的命令行工具

Answers:


1

对于您来说,解决方案可能与我相同,已经在我发布的帖子中编写了(从AppStore更新中删除已卸载的命令行工具)。

启动恢复以禁用SIP,然后删除文件,然后再次启用SIP。希望这也适合你(似乎与我的问题完全相同)。

编辑:也许你的实际问题是它为什么看错了收据的路径。我不知道,我想知道自己。:)

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.