Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.cache && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
@owlboy

This comment has been minimized.

Copy link

commented Nov 3, 2016

Great!

@mac-n-cheese

This comment has been minimized.

Copy link

commented Dec 18, 2016

Help! I'm not code savvy. Does this code apply only to XQuartz.app downloaded from macosforge.org? It's not working for me as is. Terminal responds: 'No receipt for 'org.macosforge.xquartz.pkg' found at '/'. I downloaded from xquartz.org, not Macosforge. Name of package I downloaded is just xquartz.pkg. Can I substitute org.macosforge with org.xquartz?

@pwnsdx

This comment has been minimized.

Copy link
Owner Author

commented Mar 1, 2017

@owlboy: Thanks!

@mac-n-cheese: Yes you can but I believe org.macosforge.xquartz.pkg is the only pkg name available.

@mattoo

This comment has been minimized.

Copy link

commented Mar 22, 2017

hello, thanks for the code !!

My Mac says "Forgot package 'org.macosforge.xquartz.pkg' on '/'." is that a big deal ?

thanks again ;)

ps: after checking, my /opt folder has reduced from 130Go to OGo... which sounds quite good ^^

@aisk

This comment has been minimized.

Copy link

commented Mar 28, 2017

Hi i think rm ~/.cache is not a good idea, since some other software was using this path as cache folder (like bower and more, but i don't know now since it was deleted by this gist).

@pwnsdx

This comment has been minimized.

Copy link
Owner Author

commented Apr 19, 2017

hello, thanks for the code !!
My Mac says "Forgot package 'org.macosforge.xquartz.pkg' on '/'." is that a big deal ?
thanks again ;)
ps: after checking, my /opt folder has reduced from 130Go to OGo... which sounds quite good ^^

Sure no problem.

The fact that he forgot the package actually means it has been uninstalled.

Hi i think rm ~/.cache is not a good idea, since some other software was using this path as cache folder (like bower and more, but i don't know now since it was deleted by this gist).

Maybe, I'll have to reinstall it to see which directory XQuartz use inside ~/cache which I probably won't do. Anyway it's just cache files so.

@ryenus

This comment has been minimized.

Copy link

commented Dec 13, 2017

@pwnsdx, probably only ~/.cache/fontconfig/ and ~/.cache/fontforge/.

@kmbuki

This comment has been minimized.

Copy link

commented Jun 10, 2018

Perfecto 👍

@Burkehaven

This comment has been minimized.

Copy link

commented Sep 26, 2018

Thanks for this.

@andalike

This comment has been minimized.

Copy link

commented Oct 19, 2018

Thanks

@jabalazs

This comment has been minimized.

Copy link

commented Dec 18, 2018

Thank you!

@asha23

This comment has been minimized.

Copy link

commented Dec 19, 2018

Great, worked perfectly thanks... It's not nice not being able to easily uninstall something you no longer need from your computer.

@helio-silva

This comment has been minimized.

Copy link

commented Jan 28, 2019

Thanks, very useful

@xasapakos

This comment has been minimized.

Copy link

commented Jun 19, 2019

Hi! I have a great problem. I updated the XQuartz to 2.7.11 in my MacOs Mojave and all other related software (primarily freesurfer) stopped working. I need to remove XQuartz and then install a previous version which worked. The above-mentioned script does not apply to Mojave.. Any ideas???

@ghost

This comment has been minimized.

Copy link

commented Aug 13, 2019

I used the script on Mojave and it seams like everything is gone and everything is working fine. Thanks you very much!

@gp42

This comment has been minimized.

Copy link

commented Sep 20, 2019

👍

@jeffoman

This comment has been minimized.

Copy link

commented Oct 14, 2019

same as FelixQuehi.
Thanks !

@barbhackk

This comment has been minimized.

Copy link

commented Oct 17, 2019

Hi,
Before I used Xquartz for Inkscape. The version 1.0 Beta of Inkscape now works natively on macOS Catalina. To uninstall Xquartz it's almost the same thing.

launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz  && \
sudo pkgutil --forget org.macosforge.xquartz.pkg  && \
rm -rf ~/.Xauthorit* && rm -rf ~/.cache && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.