Skip to content

Instantly share code, notes, and snippets.

@maxshaw
Forked from githubutilities/Uninstall-pkg.md
Created January 10, 2017 13:31
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 maxshaw/5c32f2bbff239223bfc7b68300f1159a to your computer and use it in GitHub Desktop.
Save maxshaw/5c32f2bbff239223bfc7b68300f1159a to your computer and use it in GitHub Desktop.
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info <your-package-id>

# list your package files
pkgutil --files <your-package-id>

# change to the directory which your package is installed into
cd /
# remote files
pkgutil --only-files --files <your-package-id> | tr '\n' '\0' | xargs -n 1 -0 sudo rm -if
# remote directories
pkgutil --only-dirs --files <your-package-id> | tail -r | tr '\n' '\0' | xargs -n 1 -0 sudo rmdir

Reference

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