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
相关推荐
FreeBuf_10 小时前
原子级 macOS 信息窃取程序升级:新增后门实现持久化控制
macos·信息窃取
CHANG_THE_WORLD13 小时前
「macOS 系统字体收集器 (C++17 实现)」
开发语言·c++·macos
小Lu的开源日常13 小时前
在 macOS 上设置 SSH 和 Git
git·macos·ssh
朴拙数科15 小时前
在 macOS 上安装与自定义 Oh My Zsh:让终端美观又高效 [特殊字符]
大数据·elasticsearch·macos
小Lu的开源日常16 小时前
在 Mac 上使用 iTerm2 和 Oh My Zsh 打造优雅终端
macos·iterm·命令行
tonngw18 小时前
【Mac 从 0 到 1 保姆级配置教程 19】- 英语学习篇-我的英语工作流分享(AI 辅助学习)
macos·mac·英语学习·沉浸式翻译·欧路词典·沙拉查词·终生学习
lianyinghhh18 小时前
yolo8实现目标检测
yolo·目标检测·macos
困惑阿三21 小时前
Mac mini 高性价比扩容 + Crossover 游戏实测 全流程手册
游戏·macos
Jay_271 天前
Mac-右键用 VS Code 打开文件夹
macos
一只帆記2 天前
Mac中Minicom串口调试基础使用
macos