Running Homebrew as root is extremely dangerous and no longer supported

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
相关推荐
起司喵喵17 小时前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛17 小时前
macOS Google Chrome 常用快捷键
前端·chrome·macos
啊真真真17 小时前
macOS下libnfc ..写卡失败问题及解决方案
macos·策略模式
叶 落18 小时前
Mac 通过 Miniconda 安装 Python
python·macos·conda·miniconda
it-电商达人1 天前
告别手动对齐!Mac播放器Popvee Player支持本地AI自动生成字幕
人工智能·macos
2501_916008891 天前
iOS IPA文件反编译与打包操作方法,拆包分析防护和加固打包
android·macos·ios·小程序·uni-app·cocoa·iphone
凯丨1 天前
2GB 内存跑 Gemma 4 26B 模型:TurboFieldfare Mac 本地部署实测(2026 最新)
macos
for_ever_love__2 天前
iOS:天气预报仿写总结
macos·ui·ios·objective-c·cocoa
开开心心就好2 天前
电脑内存优化工具一键释放内存超简单
java·开发语言·macos·arcgis·ocr·excel·音视频
Tester Kid2 天前
Appium 元素定位深度讲解:五种方式逐个拆 + Inspector 完整用法
macos·appium·cocoa