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
相关推荐
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
吃汤圆的抹香鲸1 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
甜于酸12 小时前
MuMu模拟器Pro for Mac 安卓手机平板模拟器
android·macos·智能手机
渔夫阿布13 小时前
在MAC上面通过HomeBrew安装node和npm@指定版本
前端·macos·npm
waicsdn_haha13 小时前
TeX Live 2025 最新版安装与中文环境配置全教程(Windows/Mac/Linux)
linux·windows·macos·论文笔记·sublime text·mdk·嵌入式开发工具
xinyu39118 小时前
iOS Framework代码中加载图片资源
macos·ios·cocoa
励志前端小黑哥20 小时前
brew search报错,xcrun:error:invalid active developer path CommandLineTools
macos
至天1 天前
MacPorts 创建自定义 Portfile 安装 RoadRunner
macos·安装·macports·roadrunner·portfile
南瓜胖胖2 天前
【如何提取现有seismic unix文件为头文件和道数据文件】
macos·unix·mac
南瓜胖胖3 天前
【关于seisimic unix中使用suedit指令无法保存问题】
macos·unix·seismic unix