Berkeley DB-5.3.28

Introduction to Berkeley DB

The Berkeley DB package contains programs and utilities used by many other applications for database related functions.



Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

Berkeley DB Dependencies


libnsl-2.0.0 and Sharutils-4.15.2 (for the uudecode command)

Installation of Berkeley DB

First apply a fix so that this will compile with current versions of g++:

sed -i 's/\(__atomic_compare_exchange\)/\1_db/' src/dbinc/atomic.h

Install Berkeley DB by running the following commands:

cd build_unix                        &&
../dist/configure --prefix=/usr      \
                  --enable-compat185 \
                  --enable-dbm       \
                  --disable-static   \
                  --enable-cxx       &&

Now, as the root user:

make docdir=/usr/share/doc/db-5.3.28 install &&

chown -v -R root:root                        \
      /usr/bin/db_*                          \
      /usr/include/db{,_185,_cxx}.h          \
      /usr/lib/libdb*.{so,la}                \

Command Explanations

cd build_unix && ../dist/configure --prefix=/usr...: This replaces the normal ./configure command, as Berkeley DB comes with various build directories for different platforms.

--enable-compat185: This switch enables building the DB-1.85 compatibility API.

--enable-cxx: This switch enables building C++ API libraries.

--enable-dbm: Enables legacy interface support needed by some older packages.

make docdir=/usr/share/doc/db-5.3.28 install: This installs the documentation in the standard location instead of /usr/docs.

chown -v -R root:root ...:This command changes the ownership of various installed files from the uid:gid of the builder to root:root.

--enable-tcl --with-tcl=/usr/lib: Enables Tcl support in DB and creates the libdb_tcl libraries.

--enable-java: Enables Java support in DB and creates the libdb_java libraries. Java support is currently broken with Java-9.x and higher.


Installed Programs: db_archive, db_checkpoint, db_deadlock, db_dump, db_hotbackup, db_load, db_log_verify, db_printlog, db_recover, db_replicate, db_stat, db_tuner, db_upgrade, and db_verify
Installed Libraries:,, and
Installed Directory: /usr/share/doc/db-5.3.28

Short Descriptions


prints the pathnames of log files that are no longer in use


is a daemon process used to monitor and checkpoint database logs


is used to abort lock requests when deadlocks are detected


converts database files to a flat file format readable by db_load


creates "hot backup" or "hot failover" snapshots of Berkeley DB databases


is used to create database files from flat files created with db_dump


verifies the log files of a database


converts database log files to human readable text


is used to restore a database to a consistent state after a failure


is a daemon process that provides replication/HA services on a transactional environment


displays database environment statistics


analyzes the data in a btree database, and suggests a page size that is likely to deliver optimal operation


is used to upgrade database files to a newer version of Berkeley DB


is used to run consistency checks on database files