On my systems, the only difference is that dpkg --get-selections includes packages with state "deinstall". These were previously installed and have been removed but not purged, so their conffiles and metadata remain. apt list calls these "residual-config", but it omits them with the --installed option.
There may be other edge cases, so where there is a difference I would suggest grepping the original pre-cut outputs for details.
apt list is reading /var/lib/dpkg/status for information about currently installed packages. It also has /var/lib/apt/extended_states to remember when packages were installed as dependencies, rather than explicitly.
(For anyone else wanting to try the commands, the quoted space in the first cut command needs to be a literal Tab, which you usually type with Ctrl+V Tab. It actually is a Tab in the HTML, but it did not paste correctly for me.)
There may be other edge cases, so where there is a difference I would suggest grepping the original pre-cut outputs for details.
apt list is reading /var/lib/dpkg/status for information about currently installed packages. It also has /var/lib/apt/extended_states to remember when packages were installed as dependencies, rather than explicitly.
(For anyone else wanting to try the commands, the quoted space in the first cut command needs to be a literal Tab, which you usually type with Ctrl+V Tab. It actually is a Tab in the HTML, but it did not paste correctly for me.)
Statistics: Posted by jojopi — Tue Jan 09, 2024 10:33 am