And I checked deborphan - it's removed from Debian for serious reasons
by it's maintainer, so I would not want to install an old version on
the system.

Well, I still use deborphan to remove cruft from my chroots
(the ones I use for archive rebuilds), and I can tell you
that it's still useful, at least for me. The reason it was
removed from trixie is that in trixie it may have false positives,
but the tool by itself does nothing when invoked from the command
line, it just tell what would be a candidate to be removed.
(i.e. it's not "dangerous").

You can also try debfoster to remove cruft, which still exists
in trixie.

And finally, you can try this script I use from time to time,
called "installed-packages-which-do-not-exist-in-trixie" which
has a self-explanatory name (needs wget to work).

Thanks.
#!/bin/sh
set -e

installed_packages() {
  cd /var/lib/dpkg/info
  ls *.list | sed -e 's/\.list//' | sed -e 's/:.*//' | LC_ALL=C sort
}

lines_in_2_not_in_1() {
  awk '{ if (FILENAME == ARGV[1]) { a[$0] = 1 } else if (! ($0 in a)) { print 
$0 } }' $1 $2
}

t=$(mktemp)
u=$(mktemp)
dist=$(basename $0 | awk -F "-" '{ print $NF }')
arch=$(dpkg --print-architecture)
mirror=http://deb.debian.org/debian
for section in main contrib non-free non-free-firmware; do
  wget -q -O - ${mirror}/dists/${dist}/${section}/binary-${arch}/Packages.gz | 
gzip -d | awk '/^Package:/ { print $2 }'
done > ${t}
installed_packages > ${u}
lines_in_2_not_in_1 ${t} ${u}
rm -f ${t} ${u}

Reply via email to