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
相关推荐
带娃的IT创业者13 分钟前
解密OpenClaw_03-OpenClaw核心功能特性
macos·系统架构·objective-c·cocoa·软件工程·智能体开发·openclaw
AI逐月2 小时前
Mac 轻量安装 Docker 完整指南(Docker + Colima + Kubernetes)
macos·docker·kubernetes
binderIPC2 小时前
macos环境下FFmpeg打包成.so文件
macos·ffmpeg·音视频
binderIPC2 小时前
macos的FFmpeg环境搭建
macos·ffmpeg·音视频
王中王程序猿23 小时前
Mac IDA动态调试Android应用so文件
macos
xifangge20253 小时前
[报错] SpringBoot 启动报错:Port 8080 was already in use 完美解决(Windows/Mac/Linux)
java·windows·spring boot·macos·错误解决
雪域迷影1 天前
MacOS下源码安装SDL3并运行hello.c示例程序
c语言·开发语言·macos·sdl3
阿捏利1 天前
详解Mach-O(五)Mach-O LC_SYMTAB
macos·ios·c/c++·mach-o
2601_949146531 天前
Swift语音通知接口集成手册:iOS/macOS开发者如何调用语音API
macos·ios·swift
爱喝水的木子1 天前
新mac入手装的一些好用的提高效率的软件
macos