In my case, deleted kext disappears from StagedExtensions when you invalidate kext cache.
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/
UPDATE 2019:
See man page for full details: man kextcache
.
Excerpt related to -invalidate
, -i
for short:
-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.
There are also new options:
-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.
Looks like -prune-staging
removes only the deleted extensions, shaving little bit of time from the next kext cache rebuild.
See https://www.unix.com/man-page/mojave/8/KEXTCACHE/ for Mojave man page, which contains these new options.