#6 Please add dpkg support
Closed: Fixed by plautrba. Opened by bigon.

Hello,

setroubleshoot currently only supports RPM based distributions.

It would be nice if is was possible to also support dpkg based ones (debian, ubuntu,...)

rpm executable or python binding are only used in some specific places and if I'm not wrong only 2 or 3 functions should be adjusted/added to support dpkg.

I did some quick benchmark already and it seems that calling dpkg/dpkg-query cmd line utility might be the fastest (compared to the "apt" python module).

FTR:

rpm -q could be translated to dpkg-query -f=${Package}_${Version}:${Architecture}\n -W
rpm -qfhas no direct replacement in dpkg AFAICT. You can call dpkg -S foo |cut -d: -f1to get the name of the package and then call the dpkg-query command above to get the package version and architecture

Edit: Note that dpkg -S can potentially returns multiple owners if we are looking at a directory


Work In Progress - https://gitlab.com/bachradsusi/setroubleshoot/-/commits/do-not-hardcode-rpm

Please test if you can.

Commit 1de3fd53 fixes this issue

Commit 1b5f5189 fixes this issue

Metadata