Running Homebrew as root is extremely dangerous and no longer supported
在使用homebrew安装smartmontools,查看Mac磁盘信息,包括mac磁盘写入量、mac磁盘健康、磁盘启动次数等,遇到的问题及解决方案
使用brew install smartmontools
提示无权限
直接加上sudo
再次安装
使用sudo brew install smartmontools
遇到下述报错提示
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
意思是:
- 以root身份运行Homebrew极其危险,不再受支持。
- 由于HomeBrew不会在安装时删除权限,因此您将授予所有构建脚本对您的系统的完全访问权限
尝试去掉sudo
再次安装 brew install smartmontools
注:当出现Updating Homebrew...
按control + C
跳过更新brew
还不行,执行下面的命令:
sudo chown -R `whoami` /usr/local/Homebrew/
sudo chown -R $(whoami) $(brew --prefix)/*
sudo mkdir /usr/local/Frameworks
sudo chown -R `whoami` /usr/local/Frameworks/
brew install smartmontools
下面是安装的过程截图
查看磁盘所有信息
shell
smartctl -a disk0