From a Live USB, and without using the installed Ubuntu's programs like dpkg
, dpkg-query
, dselect
, aptitude
, apt-get
, or any other (as they are all broken Illegal instruction
), how do I read the package lists that apt
reads, as a list in order to catalogue the installed packages, to reinstall later?
Reading package lists... Done
Building dependency tree
Reading state information... Done
where is local package database? is almost a perfect answer:
/var/lib/dpkg/status
is modified by dpkg if you change the state of a package, i.e. install it, remove it, mark it for some action, ...
I don't want just to list "changed" packages, but also depended packages, the entire state of the system, etc. Is that contained by
dpkg/status
?- On another healthy system, that file has ~3800
Package:
entries; on the target system it has 3600Package:
entries, and on the Live USB it has only 2000 entries. That sounds right except I worry it doesn't list all the packages.
- On another healthy system, that file has ~3800
I am not looking for the downloaded
.deb
cache, nor thecache
fordpkg
/apt
which holds temporary data files -- these do not give the full system state./var/lib/apt/lists
seems to contain a list of package sources and packages, which is almost perfect except a lot of parsing is involved in getting a list of package names from it. Is this the best option?
The file /var/cache/apt/pkgcache.bin
exists but since it's a generated binary, I don't think copying it to a fresh install will be sufficient.