How to get the program event if any other program is installed or uninstalled in Linux (Ubuntu)? Are there any GTK services for this?
My program permanently resides in memory.
How to get the program event if any other program is installed or uninstalled
Share
As far as I know, this doesn’t exist. On Debian derivatives like Ubuntu, installation is done with
dpkg, called by a selection of tools likeapt-get. One solution you could try is polling the last lines of/var/log/dpkg.log. This lists (un)installed packages, with the date and time. If you wake up every minute to do that, you won’t be miles behind the change. The file is owned by root and on my system has permissions 0644. Maybe paranoid administrators would have it at 0600 though, in which case the only thing I can think of is repeatedly runningdpkg -land looking for changes. On my system it takes about 0.1 seconds per run, so this isn’t completely crazy either.