I feel safe in managing my tasks on computers when I can always undo last operations and restore a working environment. For that reasons tools like cvs, subversion, git, etc. do exist. But the same should be true with an operating system. You do your stuff, install apps, and when unhappy of the changes you should easily be able to go back in time and have things back working as before. Simple philosophy: avoid (as much as possible) actions that you don't know how to recover, later.
Today I installed an application that was packaged into a .pkg file.
After the try I realized that I may not want to use it anymore, so I tried to uninstall it.
Surprise: there is no SAFE way to uninstall a .pkg file!
Googling around I found those two articles (and more similar ones):
How do you uninstall applications installed using a .pkg installer ?
Well, the truth is other than using third party applications to handle uninstallation there really is no way...
...unless finding out all installed files and deleting them manually. To do so you have to check ".bom" files under /Library/Receipts/ or /var/db/receipts/ using a command like:
$ lsbom -f -l -s -pf /var/db/receipts/com.foo.bar.myapp.pkg.bom
Now... is that SAFE? The answer is: NO!
Suppose your bom lists a file - let’s say a library - but that file was already present in the system before of the pkg installation. For example it might be previously existing because some other app was installing the same library. Following this method you will delete a shared library and you will break dependent programs relying on the file you have just deleted.
Notice that, in my case the files listed in the bom was with relative path:
./share/man/man3/gv.3ruby ./share/man/man3/gv.3tcl ./share/man/man3/gvc.3
In my case the files where not installed in the root, but under /usr/local.
At first I decided to go for removal, but after deleting almost everything, I tought that some shared libraries like
could be used by other apps, and deleting those files could damage my system causing unpredictable failures in the future.
So I reinstalled the application, and I am gonna keep the zombie files, just to prevent breaking things on my system.
My approach, in installing new programs, is now changed to: if a program is provided with .pkg format, don’t install it unless strictly necessary or it comes with an uninstaller. The eventual uninstaller, might also be verified, to avoid just stupid bare deletes as I was doing creating my own script to automatically delete files listed in the bom.
Now, I really hate this! Coming from Linux and apt packages, I’ll seriously think to kill the next guy who tells me that installing apps in OSX is cool. Once again, Linux rocks where OSX sucks! (and it does sucks also compared to Windows!)
Another way to see the files installed by a package is to execute the command
$ pkgutil --files com.myapp.name.pkg
It is quite disastrous that Apple doesn't came with an app to manage (and uninstall!) such packages...
|« Jan||May »|
- Android (3)
- Apple (30)
- Books (7)
- Eclipse (14)
- Errors (5)
- Firefox (7)
- Git (3)
- Hardware (18)
- Horror Code (8)
- Internet (21)
- Java (106)
- Life, universe and everything (45)
- Lifehacks (26)
- Linux (53)
- Opinions (26)
- OSX (11)
- OWNER API (3)
- Python (1)
- Software (35)
- Speeches and Conferences (8)
- Unix (5)
- Web (23)
- Windows (19)
Android apple architecture Bash bsd configuration CSS Development Düsseldorf framework free Git Google Hardware hdr How-To howto Java Karmic library Linux lion MacBook maven opensource Open Source Opinion os x OSX owner owner api patterns Pitfalls Practices properties Software TDD Testing tip tonemapped Tricks Ubuntu unix video Web