jqtmviyu
V2EX  ›  macOS

请问如何删除根目录下的"opt"文件夹

By jqtmviyu at 2023 年 1 月 10 日 · 3289 次点击

该文件夹是怎么来的

装navidrome时, 按照官方教程"extracted to the /opt/navidrome folder", 用 cp 命令自动创建的

为什么要删除

改路径了, 放到非根目录了, 方便修改配置文件

确定是自己创建的?

印象中是的, 内部是空的, 也不是链接, 大小为 0bit

做过哪些尝试

  • √ 关闭 sip
  • sudo 删除: Read-only file system
  • 挂载: Read-only file system
  • 进恢复模式下删除: Read-only file system

类似的问题 "Opt" Folder - Apple Community

csrutil status
System Integrity Protection status: disabled (Apple Internal)

csrutil authenticated-root
Authenticated Root status: disabled

sudo rm -rf /opt
rm: /opt: Read-only file system

sudo mount -uw /
mount_apfs: volume could not be mounted: Permission denied
mount: / failed with 66
第 1 条附言  ·  2023 年 1 月 11 日

感觉热心的各位. 那我就不管它了.

因为是intel版本的, 真没有遇到使用/opt路径的.

What is standard for OS X filesystem? e.g. /opt/ vs. /usr/

6 条回复  •  2023-01-11 13:26:10 +08:00
kkkkkkhalil
   1
kkkkkkhalil  
   2023 年 1 月 10 日   ❤️ 1
/opt 是 macOS 上安装测试软件时使用的文件夹,是系统自带的,不是你自己创建的

其实不止是测试软件,比如 m1 的 homebrew 就安装在 opt 目录下,我个人也有很多软件放在了 /opt 目录下

你可能对这个目录有误解
zhanglintc
   2
zhanglintc  
   2023 年 1 月 10 日
确实,这玩意儿没必要删吧
lrigi
   3
lrigi  
   2023 年 1 月 11 日 via iPhone   ❤️ 2
楼主都找到苹果那个网页了,没看到里面的加星的回答嘛
“ In short, don't try to delete the /opt folder. As a Linux user who recently switched to OS X, I can tell you that the /opt folder is used by various programs to install libraries and the like. Every Linux/Unix system I have ever used has this folder in this exact location. Depending on the nature of the software that you use, this folder may or may not be empty. ”
chenzhongxiang
   4
chenzhongxiang  
   2023 年 1 月 11 日 via iPhone
Linux/Unix 系统都在很早使用了这个目录结构,后来在 Linux 中被标准化了 https://refspecs.linuxfoundation.org/fhs.shtml ,因此不要去动它。
Tink
   5
Tink  
   2023 年 1 月 11 日
别删吧
Chingim
   6
Chingim  
   2023 年 1 月 11 日 via iPhone
强迫症活得这么痛苦吗
© 2026 V2EX · 33ms · 3.9.8.5