Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

diff two rpms? -- linux

Tags:

linux

diff

rpm

Some unknown changes were made to my baseline (java/ C++) and installed in a new rpm. I would like a way to compare the content of this rpm with an old one to see the changes made. Is this possible?

If there is no easy way to do this, is there a way to get a content list of rpm file names within it organized by date?

like image 732
JavaBeast Avatar asked Dec 14 '15 19:12

JavaBeast


People also ask

How do I compare two rpm files in Linux?

If you just want to get the list of files in the package with dates, you can run rpm -qlv mypackage . Drop the extension . rpm . The command should be rpm -qlv myRPM , or whatever the whole package name was displayed when grepping for myRPM .

What rpm stands for in Linux?

RPM stands for Red Hat Package Manager. It was developed by Red Hat and is primarily used on Red Hat-based Linux operating systems (Fedora, CentOS, RHEL, etc.). An RPM package uses the . rpm extension and is a bundle (a collection) of different files.

How do I list an rpm in Linux?

To view all the files of an installed rpm packages, use the -ql (query list) with rpm command.

What are Rhel RPMs?

The RPM Package Manager (RPM) is a package management system that runs on RHEL, CentOS, and Fedora. You can use RPM to distribute, manage, and update software that you create for any of the operating systems mentioned above.


2 Answers

Try pkgdiff to visualize differences between RPM packages:

pkgdiff PKG-0.rpm PKG-1.rpm

If you compare SRC.RPM then the tool will extract and compare the internal tarball too (unless the -skip-subarchives option is defined).

enter image description here

enter image description here

like image 77
linuxbuild Avatar answered Sep 24 '22 14:09

linuxbuild


To rigorously compare two rpm files (let's call them one.rpm and another.rpm), you'll want to check the digests of the constituent files as well as check the pre- and post-[un]install scripts (because these scripts might modify the system state):

$ diff <(rpm -q --dump --scripts -p one.rpm) <(rpm -q --dump --scripts -p another.rpm)

You might also want to compare the signatories (if there are any):

$ diff <(rpm -q --qf '%{SIGPGP:pgpsig}\n%{SIGPGP:armor}\n' -p one.rpm) <(rpm -q --qf '%{SIGPGP:pgpsig}\n%{SIGPGP:armor}\n' -p another.rpm)

(or, if you're especially pedantic:

$ diff <(rpm -q --qf '%{DSAHEADER:pgpsig}\n%{DSAHEADER:armor}\n%{RSAHEADER:pgpsig}\n%{DSAHEADER:armor}\n%{SIGGPG:pgpsig}\n%{SIGGPG:armor}\n%{SIGPGP:pgpsig}\n%{SIGPGP:armor}\n' -p one.rpm) <(rpm -q --qf '%{DSAHEADER:pgpsig}\n%{DSAHEADER:armor}\n%{RSAHEADER:pgpsig}\n%{DSAHEADER:armor}\n%{SIGGPG:pgpsig}\n%{SIGGPG:armor}\n%{SIGPGP:pgpsig}\n%{SIGPGP:armor}\n' -p another.rpm)
)

like image 45
jhfrontz Avatar answered Sep 24 '22 14:09

jhfrontz