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
相关推荐
2501_9222329416 小时前
Mac电脑 系统监测工具 System Dashboard Pro
macos
大猩猩爱分享1 天前
Mac安装docker desktop
macos·docker
伊织code1 天前
pmset - 控制 macOS 系统电源、睡眠、唤醒与节能
macos·命令·电源·睡眠·节能·唤醒·pmset
serve the people1 天前
在mac上安装sh脚本文件
macos
莫邪博客1 天前
解决蓝牙MAC 地址倒序问题
macos
草明1 天前
macOS 查看当前命令行的ruby的安装目录
开发语言·macos·ruby
五阿哥爱跳舞1 天前
MAC无法 ping 通github 系列主页
macos
前端 贾公子2 天前
「混合开发」H5与原生App交互流程方案全面解析
macos·objective-c·cocoa
I烟雨云渊T2 天前
2025年的WWDC所更新的内容
macos·ios·wwdc
Fatbobman(东坡肘子)2 天前
WWDC 2025 开发者特辑 | 肘子的 Swift 周报 #088
开发语言·macos·ios·swiftui·ai编程·swift·wwdc