Bug 1680089

Summary: smaller rpmdb (in general but particularly for the more minimal UBI container)
Product: Red Hat Enterprise Linux 8 Reporter: Frantisek Kluknavsky <fkluknav>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: fedoraproject, ffesti, mjenner, walters
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1669675 Environment:
Last Closed: 2019-03-12 11:30:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1669675    

Description Frantisek Kluknavsky 2019-02-22 17:13:06 UTC
+++ This bug was initially created as a clone of Bug #1669675 +++

Person A: Today the rpmdb in the container is large:

```-rw-r--r--  0 0      0      528384 Jan 25 15:34 var/lib/rpm/Basenames
-rw-r--r--  0 0      0     1318912 Jan 25 15:34 var/lib/rpm/__db.003
-rw-r--r--  0 0      0     6623232 Jan 25 15:34 var/lib/rpm/Packages```

Person B: yeah.. i bet the changelogs are a large part of that too

I think the RFE here is for a much smaller rpmdb particularly for our microdnf-based container.

--- Additional comment from Frantisek Kluknavsky on 2019-02-22 17:12:01 UTC ---

Let us start by asking for advice, cloning this for rpm.

Comment 1 Frantisek Kluknavsky 2019-02-22 17:15:49 UTC
Hi, please, as stated in the original request, is it possible to make rpm database smaller, while keeping rpm and microdnf (mostly) working?

Comment 2 Florian Festi 2019-03-12 10:51:29 UTC
If you have control over what/dnf rpm instances are running you can delete these /var/lib/rpm/__db.* files after all instances have finished.

Comment 3 Florian Festi 2019-03-12 11:30:14 UTC
Oh, on thinking a bit harder: You can delete everything except the Packages file. RPM rebuilds the other files if they are missing.

In theory rpm could try harder to minimize the rpmdb. One way would be compressing the headers in the Packages file. But this is out of scope here. You can try to put it on a compressed file system, though.

Closing.