Skip to content

Instantly share code, notes, and snippets.

@rtfpessoa
Forked from uchida/uninstall_mactex.sh
Last active September 6, 2015 21:38
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 rtfpessoa/1324e985ee2e2fa4560a to your computer and use it in GitHub Desktop.
Save rtfpessoa/1324e985ee2e2fa4560a to your computer and use it in GitHub Desktop.
MacTeX uninstaller script based on pkgutil command
#!/bin/bash
# MacTeX uninstaller script based on pkgutil command
# by Akihiro Uchida, CC0 dedicated to the public domain
# see http://creativecommons.org/publicdomain/zero/1.0/
IFS=$(echo -en "\n")
for pkg in $(pkgutil --pkgs|grep org.tug.mactex); do
volume="$(pkgutil --pkg-info "$pkg"|grep volume|cut -d' ' -f2-)"
location="$(pkgutil --pkg-info "$pkg"|grep location|cut -d' ' -f2-)"
echo "remove all of the files installed under the $pkg"
for file in $(pkgutil --files "$pkg"); do
rm -rf "${volume}${location}/${file}"
done
pkgutil --forget "$pkg"
done
echo "remove TeX Distribution pane on the System Preferences.app"
rm -rf /Library/PreferencePanes/TeXDistPrefPane.prefPane
echo "remove items in /Library/TeX"
rm -rf /Library/TeX/.scripts /Library/TeX/Distributions
rm -f /Library/TeX/Documentation /Library/TeX/Local /Library/TeX/Root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment