User Tools

Site Tools


This is an old revision of the document!

RPM 5.x quick guide

General information

Changes in rpm operation that should interest both users and developers.

Upgrading from rpm4 and/or older BDB

Rpm database upgrade is done automatically during package installation, so there is need to do anything.
But, in case that upgrade did not happen for some reason, here is the command to do it manually:

/usr/lib/rpm/bin/dbconvert --rebuilddb

Fixing database problems

You can't just do 'rm -rf /var/lib/rpm/__db*' to fix problems anymore, also –rebuilddb is largely obsolete in rpm-5.3.x and isn't likely to “fix” anything. Instead:

cd /var/lib/rpm
dbX.Y_recover -ev

Querying database

The semantics of rpm query option -f (–file) has changed in rpm 5.x; 'rpm -q -f <file-with-path>' will not resolve all symlinks in queried file's path. So the query (assuming /usr/src/linux is a symlink to /usr/src/linux-A.B.C-R):

rpm -q -f /usr/src/linux/include/linux/fs.h

That returned kernel-headers-A.B.C-R.arch.rpm with old rpm, will return nothing with rpm 5.x. You have to do 'readlink -f' first, or change to symlinked directory and do relative path query.

DB_BUFFER_SMALL error messages

You may see errors like this:

db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value

It appears to be some type of a bug in the BerkleyDB 5.3.x. In an attempt to workaround the problem, when we encounter this situation we attempt to adjust the size of the mmap buffer until the call works, or we end up trying 10 times.

If DBI debugging is enabled, additional diagnostics are printed, otherwise a basic retry and success message is added to show that the failure was resolved.

Packaging changes

Below is a list of changes in build system that should interest PLD developers.

Build options

  • /var/tmp is now used when TMPDIR environment variable is not set, the reason for this change is to avoid future problems if/when systemd forces it's way of /tmp as tmpfs
  • -Wformat -Werror=format-security options are added to compiler flags, more information about it can be found on Mandriva Wiki
  • Stack Smashing Protector is also enabled by default, if you really MUST disable SSP then undefine _ssp_cflags macro

Loading additional macros in .spec files

With old rpm 4.x several macro files were loaded in .spec files via #include directive:

%include /usr/lib/rpm/macros.perl

In rpm 5.x those macro files have been moved to /usr/lib/rpm/macros.d/ directory, and must be loaded using %{load:} directive. However the old statement still works, as it contains the same code to load the macros.


Excluding dependencies

Regexp patterns for '_noauto*' macros changed slightly, and '(' must be escaped now, for example:

%define _noautoreq 'perl\\(something::.*\\)'
rpm5.1349700817.txt.gz · Last modified: 2012-10-08 14:53 (external edit)