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
相关推荐
森之鸟9 小时前
Mac电脑上如何打印出字体图标
前端·javascript·macos
m_1368712 小时前
Mac M 系列芯片 YOLOv8 部署教程(CPU/Metal 后端一键安装)
yolo·macos
搜狐技术产品小编20231 天前
CAEmitterLayer:iOS 中创建炫酷粒子效果的魔法工具
macos·ios·objective-c·cocoa
未来之窗软件服务2 天前
操作系统应用开发(七)mac苹果模拟器——东方仙盟练气期
macos·仙盟创梦ide·东方仙盟·系统模拟器
liliangcsdn2 天前
Mac本地docker安装Kibana+ElasticSearch
elasticsearch·macos·docker
千寻简2 天前
远程连接Mac操作ClaudeCode一直提示登录Invalid API key · Please run /login
macos
小朋友,你是否有很多问号?2 天前
Mac安装hadoop
hadoop·macos
脚踏实地的大梦想家2 天前
【Docker】P2 Docker环境构建准备:MacOS 与 Linux
linux·macos·docker
dyxal2 天前
使用tree命令导出文件夹/文件的目录树( Windows 和 macOS)
windows·macos·策略模式
心灵宝贝3 天前
Kite Compositor for Mac v2.1.2 安装教程|DMG文件安装步骤(Mac用户必看)
macos