我认为这个位置与用户批准的扩展有关,但我想找到一种方法来删除/卸载它们。如果尝试删除这些扩展,即使具有 root 权限也会显示“操作不允许”。
有任何想法吗?
有一种新的方式来清除StageExtensions文件夹,如下所示
sudo kextcache --clear-staging
此命令将清空 /Library/StageExtensions 文件夹。若安装软件时出现权限错误,我们无需进入恢复模式并手动删除该文件夹。
sudo rm -rf /Library/Extensions/Parallel\ Desktop.app # check if the name is correct so you don't delete some other kext
sudo kextcache -invalidate /
# now you should not see your deleted kext here
ls /Library/StagedExtensions/
更新2019:
有关所有详细信息,请参见man页面:man kextcache
。
与-invalidate
相关的摘录,简写为-i
:
-i os_volume, -invalidate os_volume
Rebuild out-of-date caches and update any helper partitions
associated with os_volume.
This option mimics sudo touch /System/Library/Extensions on
os_volume. If kextcache cannot find or make sense of
os_volume/usr/standalone/bootcaches.plist, the volume is treated
as if no caches need updating: success is returned.
还有新的选项:
-clear-staging
Clears the kernel extension staging area by removing all staged content.
-prune-staging
Prunes the kernel extension staging area by removing all kernel extensions
no longer present in their original location.
看起来 -prune-staging
只会删除已删除的扩展,从下一次 kext 缓存重建中节省了一点时间。
请参阅 Mojave 手册页 https://www.unix.com/man-page/mojave/8/KEXTCACHE/,其中包含这些新选项。
sudo kextcache --clear-staging
这条命令在文件夹HD/Library/
中执行。
提示:我相信Parallels会将某些文件直接写入引导加载程序/内核。在按住CMD+R键重启Disk Utility Terminal后运行此命令后,扩展名从/Library中被移除了。
希望这样讲清楚了。
我曾经遇到了卸载ScreenFlow的TelestreamAudio.kext的类似问题。可能出现的情况是,当您处于常规模式时,StagedExtensions中的kext正在使用或受保护。一旦进入恢复模式,您就可以在不禁用系统完整性保护的情况下删除它。以下步骤对我有效,但请谨慎操作。
.
cd /Volumes/Macintosh\ HD/Library/StagedExtensions/Library/Extensions/
rm -rf NAME_OF_EXTENSION.kext
从那里开始,我能够重新安装ScreenFlow的音频kext并使其正常工作。这也可能帮助您完全删除Parallels kext。
如果您已经从/Library/Extensions
中删除了扩展程序,请从启动台打开终端应用程序,复制/粘贴以下命令并按Enter键运行:
sudo kextcache -prune-staging
如其他评论中提到的,这将仅删除不再位于其原始位置即/Library/Extensions
中的内核扩展程序。
您从/Library/Extensions
中删除的扩展程序将随后从/Library/StagedExtensions/
中消失。这不会影响其他内核暂存的扩展程序。
/Library/StagedExtensions/
是一个中间缓存区,用于在您启动会话后存储您的扩展程序。如果对/Library/Extensions
进行更改,暂存区不会立即受到影响,我认为这旨在提高稳定性和安全性。
csrutil disable
,然后按回车键。csrutil enable
。