I am trying to compare two debian 11 systems (server 1 and server2), a debian 9 and a 11 system (server 3 and server 2) and make sure they have the same packages. I intend to install the missing packages using ansible.
I looked at Where does Debian store the list of installed packages? but it doesn't show the apt package version and also shows the dependencies. I just need debian packages with version numbers that are installed on system1 so that I can do a diff on system2 and install the missing packages.