There is something strange with RPM packages. The listed contents, enumerated by rpm -ql differ from the actually presented files. For instance, I downloaded a openldap-servers-2.4.26-8.fc16.i686.rpm and ran the one-liner:

rpmfile=openldap-servers-2.4.26-8.fc16.i686.rpm; diff <(rpm2cpio $rpmfile | cpio -t | sed -e 's!^\.!!g') <(rpm -ql -p $rpmfile)

It compares the contents of the rpm unpacked by rpm2cpio with output from rpm -ql

And got:

9122 blocks
> /etc/openldap/slapd.conf
> /etc/openldap/slapd.conf.bak
> /etc/pki/tls/certs/slapd.pem

rpm -ql states that there are 3 files in the package which actually are absent.
Is there an explanation for that?


RPM packages are built using a .spec file that contains various sections that tell rpm what to do as it installs your package. The files that you are seeing are most likely being created on the fly by rpm as it installs the openldap package. The rpm -ql command is actually reading the .spec file and telling you exactly what will be installed, while the cpio command is just dumping a list of files that are archived in the .rpm. If you're really curious you can download openldap-2.4.26-8.fc16.src.rpm, install it and look at the .spec file for yourself, it's pretty straight forward to read. Careful building though, an incorrect path combined with running rpmbuild as root can really ruin your day.

  • Thank you. I have already examine source package and post install scripts. You are right. It is "temp" files for creatig initial slapd.d config. – dchirikov Jan 13 '13 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.