2

On Suse-Linux you have gzipped backups of the rpmdb: https://www.novell.com/documentation/suse91/suselinux-adminguide/html/ch02s03.html#sec:rpm.anfragen

But how can I get the list of all installed packages from this file?

If I unzip it, it is this file type:

file Packages-20160323 
Packages-20160323: Berkeley DB (Hash, version 8, native byte-order)

I tried rpm --dbpath but this options wants a directory and not a berkley-db-file....

guettli
  • 3,591
  • 17
  • 72
  • 123

1 Answers1

2

I found this solution:

#!/bin/bash
# get-package-list-from-backup.sh
set -e
set -x
cd /var/adm/backup/rpmdb
for gzipfile in *.gz; do (
 base=${gzipfile/.gz/}
 dir=/var/tmp/rpmdb-restore-$base
 mkdir $dir
 cp $gzipfile $dir
 cd $dir
 gunzip $gzipfile; mv $base Packages
 rpm --dbpath $dir -qa | sort > qa.list )
done

Now I can see the differences:

vimdiff /var/tmp/rpmdb-restore-Packages-20150625/qa.list /var/tmp/rpmdb-restore-Packages-20160311/qa.list
guettli
  • 3,591
  • 17
  • 72
  • 123