Re: how to find the original install version
On Fri 09 Dec 2022 at 12:40:48 (+0000), Bonno Bloksma wrote:
>
> Some of my Debian installations have been done several years ago and then gotten upgrades to a new version.
> Like I have a system that started as a Debian 8 machine and is now at Debian 11,
>
> But... how do I find out when a particular machine started it's life, is there a way to find out?
I don't think that /var/log/installer/ ever gets rotated away, so
there should be a syslog of the original installation in there.
> How do I find out which old libraries, that are probably not being used and... worse no longer getting security updates, are still around?
I run the following (extracted from a script):
$ apt-cache dump | grep -a -e '^Package:' -e '^ Version:' -e '^ File: ' | sed -e '/Version:/{N;s/\n//}' | sed -e '/Package:/h;/Version:/{G;s/\n/ /}' | grep -v -e '^Package:' | grep -e 'File:' | sed -e 's/[ ]\+/ /g;s/ \([^ ]\+ [^ ]\+ [^ ]\+ [^ ]\+\) \([^ ]\+ [^ ]\+\)/\2 \1/' | LC_ALL=C sort > some-file
$ dpkg-query -W -f '^Package: ${Package} Version: ${Version} \n' | grep --file=- some-file | sed -e 's/^Package: //;s/ Version: /_/;s/ File: / /;'
If you pipe the output from the second command into less,
then you can find strays with the commands
/_bullseye[-_] ← this should match most lines
/! ← this will then match anything else
For example, my systems' output all contain the line:
xtoolwait_1.3-6.2 /var/lib/dpkg/status
which I have preserved from squeeze, and install manually.
> The upgrade in itself is not as problem but sometimes old libraries stay around and finding out which libraries can indeed be deleted safe might be too much work.
> I can rebuild a Debian machine quite fast and have it up and running with for instance the DHCP service within the hour having all the correct config and other stuff I want.
> I would like to know for which systems I realy need to do this. ;-)
Cheers,
David.
Reply to: