I'm using Kubuntu. I'd like to get a list of installed packages on my system, and in particular to have them sorted by category, i.e. as seen in Muon Package Manager, in the category filter tab. For a visual reference, it the left part of the window in the following image.
From inside Muon there is an option to export a list of installed packages in the File menu, but it just exports a plain list (I think that it executes the
dpkg --get-selections command) and that's not what I'm looking for.
I tried to look in the man pages of
apt-get but I failed to find any useful information.
The only clue I got is that the manual of
dpkg-query states that it is possible to sort the output by using some command options, but I haven't found how to sort by category.