Skip to content

Instantly share code, notes, and snippets.

@octlabs
Last active February 11, 2021 21:33
Show Gist options
  • Save octlabs/cf1aa22fc16397f087d0276564fedf64 to your computer and use it in GitHub Desktop.
Save octlabs/cf1aa22fc16397f087d0276564fedf64 to your computer and use it in GitHub Desktop.

Replace MacOS perl with the latest brew version

Also fix error perl version 5.32.0 can't run /usr/bin/_shasum. for brew

/usr/bin/perl with /usr/local/bin/perl

MacOS 11.x Bug Sure

Warning, not particularly recommended

Disable System Integrity Protection:

  • Disable FileValt
  • reboot into Recovery Mode
    • hold: Command-R -> Recovery Mode.
  • Utilities -> Terminal
  • csrutil authenticated-root disable
  • reboot

Normal Login:

mkdir ~/root_mount
sudo mount -o nobrowse -t apfs /dev/disk1s1 ~/root_mount
cd ~/root_mount/usr/bin
sudo mv perl perl.ori.5.28
sudo mv shasum shasum.ori
sudo ln -s /usr/local/bin/shasum .
sudoln -s /usr/local/bin/perl .
sudo bless --folder ~/root_mount/System/Library/CoreServices --bootefi --create-snapshot
sudo umount root_mount
sudo reboot

Reset System Integrity Protection

FAILED :(

MacOS 10. Catalina

Disable System Integrity Protection:

  • reboot
  • hold: Command-R -> Recovery Mode.
  • Utilities -> Terminal
  • csrutil disable
  • reboot

Normal Login:

  • login
  • open Terminal
  • sudo mount -uw /
  • sudo mv /usr/bin/perl /usr/bin/perl.ori.5.28
  • sudo ln -s /usr/local/bin/perl /usr/bin/perl
  • sudo mv /usr/bin/shasum /usr/bin/shasum.ori
  • sudo ln -s /usr/local/bin/shasum /usr/bin/shasum

Reset System Integrity Protection

  • Reboot in Rescue (1.)
  • csrutil status
  • csrutil enable
  • reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment