Mac OS and Installers
Everyone who switched to Mac OS was pleasantly surprised that in many cases the installation of programs on this operating system comes down to a simple “Drag and drop a program into the“ Programs ”folder” and that's it. Then just click on it and it starts. I got a lot of pleasure from such a simple, friendly and understandable approach. I clearly understood: where I put the program, there I will delete it and it will simply disappear. Lepo, and only. Probably many have heard about such a glorious approach to makosi. But alas (or fortunately) there is nothing perfect and programs need to be installed on a poppy, in the full sense of the word.
I was a little disappointed in my time, but until recently it somehow did not cause any special problems, because I used a normal software, which usually supplied with uninstaller scripts for .pkg packages. But now I decided to install the FontForge font editing program, which was originally developed under the linux ideology and it immediately brought a mess around - FontForge.pkg began methodically spreading itself across all sorts of folders instead of simply placing it in "/Applications/FontForge.app" . To further complicate the situation, FontForge lacked any kind of uninstaller. When it came time to remove FontForge, I asked myself a very reasonable question: how can you remove the program installed from .pkg, which does not offer a full-fledged uninstaller, in human terms? I would agree to clean everything with my hands, but I simply did not know where pkg scattered the files on the disk.
Theory
Searching for manuals I found a more or less decent way. To do this, you have to go to the console level to uninstall this and similarly installed programs. This is done using the console utility lsbom.
It so happened that the main part of the data on already installed packages, starting with Mac OS 10.6, lies in the "/ var / db / receipts /" folder in the form of .bom (bill of materials) files. Some of the packages (with bom files inside) are in the old place "/ Library / Receipts /" - this is the main place for previous versions of mac os. Since in versions of os os up to 10.6 bom files could lie in packages, it looked (and looks) like this:
')
/Library/Receipts/some_app.pkg/Contents/Archive.bom
Starting from 10.6, bom files can basically be found like this:
/var/db/receipts/AppName.bom
As you probably already guessed, the bom file contains information about what was written to the file system during the installation of a particular package.
Practice
Finally, the commands themselves remove the installed package with comments:
# :
# lsbom -fls
# cd / - , .. "."
# xargs rm, root
lsbom -fls /var/db/receipts/AppName.bom | (cd /; sudo xargs rm)
# .
lsbom -dls /var/db/receipts/AppName.bom | (cd /; sudo xargs rmdir -p)
#
sudo rm AppName.bom AppName.plist
Possible problems
You have to be very careful with these commands. they are first executed as root, and secondly at the root of the file system. Before similarly removing the installed package, make sure that the lsbom in the file list does not accidentally indicate any path that, if removed from the root, will delete the system files. Also, do not try to remove the system packages from Apple - you will have problems with the update and even God knows what.
Of course, I know about the third-party utility PackageAssistant, which allows you to manage packages in the system, but its latest update dates back to 2008. The analysis of its source files by me only confirms that it is not suitable for Mac OS 10.6, since it only processes bom files from the packages located in "/ Library / Receipts", and this, as I said, is applicable only to 10.6.
PS : In general, all this is a matter of the integrity of the programmers who are responsible for the development of the installer (especially given the fact that Apple does not provide regular gui tools for working with the installed packages). Under the remaining systems, there are also enough irresponsible programs, after which the system can be cleaned of rubbish for days. No system is immune from this.
UPD : As I was told in the kamenta, you can also use another console utility (it is also not 100% panacea, but you can try both ways):
pkgutil --unlink PkgName
UPD2 :
Migrated to Mac OS X