V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jqtmviyu
V2EX  ›  macOS

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

  •  
  •   jqtmviyu · 2023-01-10 23:39:26 +08:00 · 1662 次点击
    这是一个创建于 442 天前的主题,其中的信息可能已经有所发展或是发生改变。

    该文件夹是怎么来的

    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-01-11 13:01:48 +08:00

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

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

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

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

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

    你可能对这个目录有误解
    zhanglintc
        2
    zhanglintc  
       2023-01-10 23:58:47 +08:00
    确实,这玩意儿没必要删吧
    lrigi
        3
    lrigi  
       2023-01-11 00:00:11 +08:00 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-01-11 04:21:08 +08:00 via iPhone
    Linux/Unix 系统都在很早使用了这个目录结构,后来在 Linux 中被标准化了 https://refspecs.linuxfoundation.org/fhs.shtml ,因此不要去动它。
    Tink
        5
    Tink  
       2023-01-11 08:58:51 +08:00
    别删吧
    Chingim
        6
    Chingim  
       2023-01-11 13:26:10 +08:00 via iPhone
    强迫症活得这么痛苦吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5505 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 09:02 · PVG 17:02 · LAX 02:02 · JFK 05:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.