This is an old problem that I find nothing online for.
I cannot use dpg -l as the partition wont boot. I can access all files on the partition though.
Any idea which text (hopefully) file contains a list of all the installed packages.?
I don’t think so but, all downloaded packages have local cache:
ls -l /var/cache/apt/
Another options is to look into
ls /var/lib/apt/lists/
This is why making and keeping backups is a good idea.
Thanks Nixcraft, that is not what I need.
I was looking for the individual names installed not the broad releases and archives names.
eg
I need a ilist of all installed program or library names XYZ those that was used by apt install XYZ.
The solutions above only lists the sources not the arguments themselves as e.g. dpkg -l does.
I can write a script to do it easily, if I know where to find them.
Is it not possible to use chroot on that partition to run dpkg -i natively on it ?
Backups of the OS is a moot point. I stopped doing that decades ago. I only backup user accounts in triplicate. On rackservers I have hard drive copies I can hot swap for critical OS with zero downtime required. Other than that I found that backing up client OS is a complete waste of time. It is always recoverable or a simple standard reinstall fixes all, home directories and nfs volumes are all that matters for me.
Intis case there is no issue, it will make things easier, but is not at all crucial.