def recreate_rpm_database(guestfs, guestfs_helper)
      @log.debug "Recreating RPM database..."

      guestfs.download("/var/lib/rpm/Packages", "#{@dir.tmp}/Packages")
      @exec_helper.execute("/usr/lib/rpm/rpmdb_dump #{@dir.tmp}/Packages > #{@dir.tmp}/Packages.dump")
      guestfs.upload("#{@dir.tmp}/Packages.dump", "/tmp/Packages.dump")
      guestfs.sh("rm -rf /var/lib/rpm/*")
      guestfs_helper.sh("cd /var/lib/rpm/ && cat /tmp/Packages.dump | /usr/lib/rpm/rpmdb_load Packages")
      guestfs_helper.sh("rpm --rebuilddb")

      @log.debug "RPM database recreated..."
    end
def recreate_rpm_database(guestfs, guestfs_helper)
      @log.debug "Recreating RPM database..."

      guestfs.download("/var/lib/rpm/Packages", "#{@dir.tmp}/Packages")
      @exec_helper.execute("/usr/lib/rpm/rpmdb_dump #{@dir.tmp}/Packages > #{@dir.tmp}/Packages.dump")
      guestfs.upload("#{@dir.tmp}/Packages.dump", "/tmp/Packages.dump")
      guestfs.sh("rm -rf /var/lib/rpm/*")
      guestfs_helper.sh("cd /var/lib/rpm/ && cat /tmp/Packages.dump | /usr/lib/rpm/rpmdb_load Packages")
      guestfs_helper.sh("rpm --rebuilddb")

      @log.debug "RPM database recreated..."
    end
https://issues.jboss.org/browse/BGBUILD-148