-1

How to get the checksum of the package when using zypper. I tried even the --xmlout option of zypper as

zypper --xmlout --no-refresh install -D -y --no-recommends MozillaFirefox.

Is there a way to get the checksum of the package to be installed?

Arun Prakash
  • 57
  • 1
  • 11
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Aug 10 '18 at 00:15

1 Answers1

-1
  1. Checksum of a rpm file

Just download the rpm file, then compute checksum using md5sum:

zypper install --download-only MozillaFirefox
md5sum $(find /var/cache/zypp/packages -name MozillaFirefox*)
  1. Checksum of files inside rpm file

Download rpm file and then run rpm command with --dump

zypper install --download-only MozillaFirefox
rpm -qp --dump $(find /var/cache/zypp/packages -name MozillaFirefox*)

The fourth column will be the checksum of a particular file.

KamilCuk
  • 120,984
  • 8
  • 59
  • 111
  • Is there a way to get the checksum without downloading the package? (As in case of `apt-get` we can get the checksum directly in a column ) – Arun Prakash Aug 09 '18 at 10:24
  • apt-get downloads the package and then prints the checksum. That's what cache is for (/var/cache/apt as i remember). Sure, you can just use curl with bash process subtitution, like: `rpm -qp --dump <(curl -sS -L 'http://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/MozillaFirefox-60.0-lp150.2.2.x86_64.rpm')` – KamilCuk Aug 09 '18 at 10:32
  • No. `apt-get` prints the checksum even without downloading packages. I gave `apt-get --print-uris --yes install checkbox`, it ouputs as 'http://archive.ubuntu.com/ubuntu/pool/universe/c/checkbox/checkbox_1.2.4-0ubuntu1_all.deb' checkbox_1.2.4-0ubuntu1_all.deb 5914 MD5Sum:6eb3220f53f5fcba3709d0b0f1f0ef7 . This curl one is okay for `openSUSE`. But what to do for `SLE` where I have different token for different urls. Is there a direct way to get from `zypper` ? – Arun Prakash Aug 09 '18 at 11:17