Is there any way to query dpkg to tell what packages have been added/removed since the base install of a system?
I am running Debian 5.
|
Is there any way to query I am running Debian 5.
| ||||
|
feedback
|
|
As far as I can tell there's not a straight-forward way to do that. Short answer (aka one-liner for the lazy)
Explanation1. Getting a list of packages installed by the installer
Note that we are looking for Setting up or Unpacking rather than eg. Selecting since we want all packages, including those installed as dependencies. We need to extract package names from that:
2. Getting a list of currently installed packagesNow we need a list of currently installed packages to do a
3. Filtering out packages installed at startupAll that's left to do is to filter out contents of the 1st list from the 2nd list. For that we use So here's the whole thing put together:
4. Verifying resultsTo check if we got the right packages we can count the lines:
Update: if
|
this is a great response...only one issue: I don't have a directory called /var/log/installer. The closest I see is /var/log/apt/ - and in my case, it's field 3 (not 8) where the package names are. I'll keep going with this example. Thanks! – AJ. May 1 '11 at 14:48 |
|
I'm using Debian testing/unstable but I think /var/log/installer has been there for quite a long time. Perhaps the package installation-report has been purged (it removes /var/log/installer). I'm not convinced whether /var/log/apt/* will list the packages you need as apt is not a required package and, as far as I can tell, is not used by the installer (or at least not all along). There is however /var/log/dpkg which should have all the entries right from the start - I will update my answer accordingly. – koniu May 3 '11 at 6:01 |
|