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
相关推荐
mortimer1 天前
从 Python+venv+pip 迁移到 uv 全过程 及 处理 torch + cuda 的跨平台指南
pytorch·python·macos
2501_915921431 天前
iOS 26 电耗监测与优化,耗电问题实战 + 多工具 辅助策略
android·macos·ios·小程序·uni-app·cocoa·iphone
Mac技巧大咖2 天前
苹果电脑如何维护优化系统:让mac重获新生的系统维护优化全攻略
macos·苹果电脑系统优化
氷泠2 天前
解决MacOS上CLion调试的时候容器的值显示为0的问题
macos·调试·lldb·clion
他们都不看好你,偏偏你最不争气2 天前
【iOS】KVC总结
macos·ios·objective-c·cocoa·kvc
1024小神3 天前
关于在ios系统中签名并安装ipa文件的五种方法,PakePlus打包的ipa文件可以看看
macos·ios·cocoa
漂亮_大男孩3 天前
conda|如何通过命令行在mac上下载conda
macos·conda
止观止3 天前
VS Code 二次开发:跨平台图标定制全攻略
linux·windows·vscode·macos
小瓶盖_tl3 天前
在Mac上安装CocoaPods问题处理
macos·xcode·cocoapods
游戏开发爱好者83 天前
苹果iOS26系统升级:液态玻璃与智能功能全解析
macos·ios·小程序·uni-app·objective-c·cocoa·iphone