Over the course of the year I've become more familiar with programming on OS X, and I think in my initial excitement I installed a whole bunch of things that I won't use and that pollute my development environment.
In particular, I find that with pip, brew, port, and easy_install, I've added all sorts of packages for all sorts of versions, and even for different systems (Snow Leopard and Mountain Lion).
So now, I was wondering if there was any way for me to start from scratch? I'd prefer to keep my files and programs, so no reinstalling the OS. If there is an easy way to mass uninstall packages for each of the four, that would help tremendously.
Thanks!
pip
and easy_install
install the mostly the same thing (both are tools that install most of the same packages).
First get a list of all installed packages, as you might want to keep some:
$ pip freeze > packages.txt
This should be a fairly large file that lists most (if not all) packages that you have installed in your default system python.
Edit that file and delete those packages that you want to keep, so it contains only those you want to get rid of (and no other lines or comments), then adjust the following script:
#!/bin/bash
for plugin in $(cat packages.txt); do
PLUGIN=$(echo "$plugin" | awk -F == '{print }')
echo "Uninstalling $PLUGIN..."
expect -c "spawn pip uninstall $PLUGIN
expect {
\"Proceed (y/n)?\" {
send \"y\r\n\"
expect {
exit
}
}
}"
done
For macports, see the uninstalling guide and associated warnings.
For brew, see this superuser question
Coincidentally, that should tell you that such questions belong at superuser.com, and not on stackoverflow - which is for programming related queries.
Don't worry - someone will eventually move your thread there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With