[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: packages status



Diogene Laerce wrote:
> >>Is there a simple way to get the list of packages installed since the fresh
> >>installation of deby ?
> >How long ago was your fresh installation?  There are backups of the
> >dpkg package status kept in /var/backups that go back a week.  And if
> >you have a system backup you could retrieve older copies going back as
> >far as your backups.  Those files list what is installed on the
> >machine and could be used to make this deduction.
> >
> >   $ zcat /var/backups/dpkg.status.6.gz | grep-dctrl -s Package -n "install ok installed" | sort > /tmp/list.prev
> >
> >   $ grep-status -s Package -n "install ok installed" | sort > /tmp/list.now
> >
> >   $ comm -3 /tmp/list.prev /tmp/list.now
> 
> Thanks a lot Mister Bob, it worked like a charm ! The install was nearly
> fresh, just 6 or 7 days and I didn't know those dctrl-tools commands so
> double thanks again. ;)
> 
> I start a script with those right now. :)

I am glad that worked for you.  A few more hints.  Debian's APT marks
packages as either being installed manually or installed automatically
as a dependency of something else.  If you get a full list of packages
that are installed then only the top level package names were
installed manually.  The rest were installed automatically.  This is
used to enable 'apt-get autoremove' functionality such that when
libraries and other autotmatically installed dependencies are no
longer needed that they can be detected as no longer being needed and
removed.

Better to separate out the top level packages and install those (which
marks them as manual) and let them automatically installed their
dependencies (which marks them as automatic) rather than install
everything (which marks the libs as manual too).  Meaning that those
libraries will never be offered for "autoremove" later when they are
no longer needed due to upgrades.

You can use the 'apt-mark' command to list and change these.

  apt-mark showmanual
  apt-mark showauto
  apt-mark auto libfoopackagename

You didn't say so I don't know why you wanted to know the package
differences.  I wanted to mention the above so that if possible you
could still track packages installed manually versus packages
installed automatically as a dependency.  It will keep the
"autoremove" functionality working for later as the system is upgraded
and keep things cleaner.

> Happy New Year !

Happy New Year! :-)

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: