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 小时前
Mac 远程连接 Windows 简明教程(2025 实测版)
windows·macos
q***046319 小时前
[golang][MAC]Go环境搭建+VsCode配置
vscode·macos·golang
斌蔚司李20 小时前
笔记本、台式机、平板二合一?Mac、Win、Linux?
linux·macos·电脑
lichong95121 小时前
harmonyos 大屏设备怎么弹出 u 盘
前端·macos·华为·typescript·android studio·harmonyos·大前端
打工人11121 小时前
安卓Android 获取mac地址及sn
android·macos
飞火流星0202721 小时前
MacOS 12(Monterey )PG安装通关指导
macos·postgresql16·mac安装pg·mac brew安装pg16
喵霓1 天前
mac系统的环境变量-bash_profile
开发语言·macos·bash
Bruce_Liuxiaowei1 天前
[特殊字符] Mac 高效排查:使用 lsof 查找和管理端口占用进程
网络·macos
2501_915909061 天前
如何防止 IPA 被反编译,从攻防视角构建一套真正有效的 iOS 成品保护体系
android·macos·ios·小程序·uni-app·cocoa·iphone
khatung1 天前
借助Electron打通平台与用户通知(macOS系统)
前端·javascript·vscode·react.js·macos·electron·前端框架