How to delete files in /System/Library/Desktop Pictures on Catalina?

I tried to delete files in the default desktop picture directory (/System/Library/Desktop Pictures) on macOS 10.15 Catalina with sudo permission but failed.

$ pwd
/System/Library/Desktop Pictures

$ sudo rm *.heic
Password:
rm: cannot remove 'Catalina Clouds.heic': Operation not permitted

Is there a hassle-free way to solve this problem?


Solution 1:

As a general rule I do not recommend deleting system files, however, if you really want to remove the default wallpapers you can do the following:

  1. Boot to macOS Recovery by pressing ⌘R when booting the Mac.
  2. Using Terminal, from the Utilities menu, use the following commands:

    cd /Volumes/Macintosh\ HD/System/Library/Desktop\ Pictures
    rm *.heic
    reboot
    

Solution 2:

Catalina now installs /System as part of a read-only volume, so it cannot be altered whilst in use.

You can modify or delete those files when booted to Recovery, but bear in mind that Apple may well restore them in an update to the OS.

Solution 3:

As of Big Sur this is no longer really feasible.

Why not?

The root filesystem on macOS has been protected strongly forever, with each of the last few OS revisions increasing protections (with SIP, etc)

macOS mounts the System area read-only and as of Big Sur makes sure to only trust it if it has not been changed.

If you violate that trust, certain parts of the system won't work again (specifically: you will not be able to re-enable FileVault afterwards)

If deleting the *.heic files is that important to you though, follow this guide Can I mount the root (system) filesystem as writable in Big Sur? (including it's warnings!)

Then from Recovery you may rm -f *.heic /Volumes/<your hard drive name>/System/Library/Desktop Pictures

I really wish I had that space back, but I need FileVault more so I gave up.