V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jqtmviyu
V2EX  ›  macOS

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

  •  
  •   jqtmviyu · Jan 10, 2023 · 2741 views
    This topic created in 1204 days ago, the information mentioned may be changed or developed.

    该文件夹是怎么来的

    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
    
    Supplement 1  ·  Jan 11, 2023

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

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

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

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

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

    你可能对这个目录有误解
    zhanglintc
        2
    zhanglintc  
       Jan 10, 2023
    确实,这玩意儿没必要删吧
    lrigi
        3
    lrigi  
       Jan 11, 2023 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  
       Jan 11, 2023 via iPhone
    Linux/Unix 系统都在很早使用了这个目录结构,后来在 Linux 中被标准化了 https://refspecs.linuxfoundation.org/fhs.shtml ,因此不要去动它。
    Tink
        5
    Tink  
    PRO
       Jan 11, 2023
    别删吧
    Chingim
        6
    Chingim  
       Jan 11, 2023 via iPhone
    强迫症活得这么痛苦吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1190 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 23:10 · PVG 07:10 · LAX 16:10 · JFK 19:10
    ♥ Do have faith in what you're doing.