On 04/10/2023 09:58, Mike Castle wrote:
The following UNTESTED commands (ran as a normal user):
(apt-mark showauto ; apt-mark showmanual) > apt-thinks-you-installed.txt
dpkg-query --show --showformat='${Package}\n' | grep -v -F
apt-thinks-you-installed.txt > rest.txt
The file "rest.txt" should have a list of packages installed that were
NOT installed via apt. With any luck, it is small enough to examine
manually.
My expectation is that rest.txt contains a list of broken or removed,
but not purged packages and an alternative way to get a similar list is
apt list '?config-files | ?broken'
or 'apt list '~c|~b'. I wonder what is the output of
dpkg-query --show --showformat='${Status} ${Package}\n' PKG
for any package from rest.txt that is still installed.