删除已卸载但保留在“允许在后台”中的软件; 清理不用的“帮助程序”; 移除内核扩展残留
删除 macOS 内已卸载但保留在“允许在后台”中的软件
可使用AppCleaner执行删除.
或可使用以下指令手动检查有哪些启动项,会在桌面生成一个文件,对应删除:
1
|
sudo -- bash -c 'echo " - $(date) -"; while IFS= read -r eachPlist; do echo "-$eachPlist"; /usr/bin/defaults read "$eachPlist"; done <<< "$(/usr/bin/find /Library/LaunchDaemons /Library/LaunchAgents ~/Library/LaunchAgents /private/var/root/Library/LaunchAgents /private/var/root/Library/LaunchDaemons -name "*.plist")"; /usr/bin/defaults read com.apple.loginWindow LogoutHook; /usr/bin/defaults read com.apple.loginWindow LoginHook' > ~/Desktop/launch.txt
|
1
2
3
4
5
6
7
8
9
10
|
# 手动检查允许在后台的文件目录
~/Library/LaunchAgents
/Library/LaunchDaemons/
/Library/LaunchAgents/
/System/Library/LaunchAgents/
/System/Library/LaunchDaemons/
~/Library/Application\ Support
ls ~/Library/LaunchAgents /Library/LaunchDaemons/ /Library/LaunchAgents/ /System/Library/LaunchAgents/ /System/Library/LaunchDaemons/ ~/Library/Application\ Support
|
清理 macOS 不用的“帮助程序”
1
|
/Library/PrivilegedHelperTools
|
移除 macOS 内核扩展残留 /Library/StagedExtensions
参考来自[stackoverflow]
有一种清除 StageExtensions 文件夹的新方法,如下所示
1
|
sudo kextcache --clear-staging
|
此命令将清除 /Library/StageExtensions 文件夹。我们不需要进入恢复模式并手动删除此文件夹,以防安装软件时出现一些权限错误。
macOS 删除不再使用的虚拟音频设备
1
2
3
4
5
6
|
cd /Library/Audio/Plug-Ins/HAL/
ls
sudo rm -rf Background\ Music\ Device.driver # 例如删除 Background Music 虚拟音频设备
# 重启 coreaudiod 服务
sudo killall coreaudiod
|