comparing installed package list from a specific repo between two systems

Hello: I have two openSUSE 15.1 installations and would like to compare their installed packages from a given repo, let's say from packman. I would like to use diff program to compare the lists of installed packages. I can produce an installed package list of the packman repo using: zypper pa -ir <packman> > list.txt The problem with this approach is that the column widths are different depending on the installed packages' names and therefore I cannot use diff to compare the lists. (All lines will be different.) Is there a way to configure zypper how to format its output? Or is there any option that makes the output usable for diff? Other solutions are also welcome. Thanks, Istvan

On 30/10/2021 20.27, Istvan Gabor wrote:
Hello:
I have two openSUSE 15.1 installations and would like to compare their installed packages from a given repo, let's say from packman.
I would like to use diff program to compare the lists of installed packages.
I can produce an installed package list of the packman repo using:
zypper pa -ir <packman> > list.txt
The problem with this approach is that the column widths are different depending on the installed packages' names and therefore I cannot use diff to compare the lists. (All lines will be different.)
Is there a way to configure zypper how to format its output? Or is there any option that makes the output usable for diff?
Other solutions are also welcome.
The reporting format of "rpm -q" is very customization, but it can not filter by repo, AFAIK. Another tool instead of diff would be "meld". It is an editor that compares two files. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))

Sat, 30 Oct 2021 20:58:12 +0200 időpontban Carlos E. R. írta:
On 30/10/2021 20.27, Istvan Gabor wrote:
Hello:
I have two openSUSE 15.1 installations and would like to compare their installed packages from a given repo, let's say from packman.
I would like to use diff program to compare the lists of installed packages.
I can produce an installed package list of the packman repo using:
zypper pa -ir <packman> > list.txt
The problem with this approach is that the column widths are different depending on the installed packages' names and therefore I cannot use diff to compare the lists. (All lines will be different.)
Is there a way to configure zypper how to format its output? Or is there any option that makes the output usable for diff?
Other solutions are also welcome.
The reporting format of "rpm -q" is very customization, but it can not filter by repo, AFAIK.
Yes, and yes.
Another tool instead of diff would be "meld". It is an editor that compares two files.
OK, I installed meld and found I can set it to ignore white spaces which solves my problem of comparing the files. Then I found that I can set kompare too to ignore white space, and use "diff -w" to ignore white space. Thank you, Istvan

Am Samstag, 30. Oktober 2021, 20:27:30 CEST schrieb Istvan Gabor:
Hello:
I have two openSUSE 15.1 installations and would like to compare their installed packages from a given repo, let's say from packman.
I would like to use diff program to compare the lists of installed packages.
I can produce an installed package list of the packman repo using:
zypper pa -ir <packman> > list.txt
The problem with this approach is that the column widths are different depending on the installed packages' names and therefore I cannot use diff to compare the lists. (All lines will be different.)
Is there a way to configure zypper how to format its output? Or is there any option that makes the output usable for diff?
Other solutions are also welcome.
Thanks,
Istvan
zypper se -sir packman > list.txt Stephan
participants (3)
-
Carlos E. R.
-
Istvan Gabor
-
Stephan Hemeier