Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
Last active July 18, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jj1bdx/a7c4c6c73afcb3d990ed2a63e904afc2 to your computer and use it in GitHub Desktop.
Save jj1bdx/a7c4c6c73afcb3d990ed2a63e904afc2 to your computer and use it in GitHub Desktop.
Fix XQuartz path on old macOS or OS X

Fix XQuartz path on old macOS or OS X

Symptoms

  • Old OS X had X11 binaries under /usr/bin (and XQuartz circa 2016)
  • Modern OS X has /usr/bin protected and unmodifiable
  • XQuartz installs the files under /opt/X11/bin
  • /usr/libexec/path_helper -s puts /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin at the top of the PATH variable

A workaround

  • Put symlinks of files under /opt/X11/bin to /usr/local/bin
  • This will prevent old unusable X11 images in /usr/bin being executed

Configuration script

  • Note: /usr/local/bin must be writable by the executing user
/bin/ls -1 /opt/X11/bin/ | \
awk "{print \"ln -s /opt/X11/bin/\" \$1 \" /usr/local/bin/\" \$1;}" | \
sh

[End of document]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment