Installation and removal under Mac is much simpler and clearer than Windows, which is obvious in the DMG mode, but many times we use pkg to install it, which is a bit cumbersome to remove.
For example, I installed Golang this pkg for Go language compilation, after installation can be used, but installed a tool chain, not an application software. So in the application directory is not content, you can find the installation in the/usr/local/go directory, but whether all the content is installed in this directory? The purpose of my removal of this pkg is to use the source code to directly compile the tool chain to apply, if there are some other configuration files missing, may lead to subsequent configuration problems.
After some searching and learning, there are two ways to find out:
1. Using the Pkgutil command
First run Pkgutil--pkgs | grep-i go, This will list the pkg containing the go word
Here we can see that after running the command list all the names containing "go" pkg, where com.googlecode.go is our Golang pkg, that is, we want to delete the pkg.
Then run pkgutil--files com.googlecode.go This command, this command will list all the installed pkg files, according to this list can be guaranteed to delete clean, no trouble.
For example, Golang pkg, although there is a long list, we can still summarize, in addition to/usr/local/go, there are etc/paths.d/go this file needs to be deleted.
2. Use the tool directly, so that you can fool a button to get it done:http://www.corecode.at/uninstallpkg/
In addition to these two methods, there are other methods, but I think these two methods are relatively clear and simple. The first method is mainly manual deletion, suitable for skilled senior engineers; The second method is one-click, which is suitable for all players.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Remove the installed Pkg under Mac