Installing Oracle Berkeley DB on Ubuntu Linux

This short tutorial shows you how to install Oracle BerkeleyDB on Ubuntu Linux Server. The process is very simple. For this tutorial, I'll be installing BerkeleyDB version 4.3.29. Linux kernel is 2.6.15-26-powerpc. I have used a Mac Mini (powerpc/ppc architecture). GCC version number is 4.0.3. Your configuration may be different from mine but the installation steps below should work fine for most configurations with little or no change at all (including other Linux distributions and even unixes e.g. MacOS x).

BerkeleyDB:

According to oracle.com,

"Oracle Berkeley DB is the industry-leading open source, embeddable database engine that provides developers with fast, reliable, local persistence with zero administration. Oracle Berkeley DB is a library that links directly into your application. Your application makes simple function calls, rather than sending messages to a remote server, eliminating the performance penalty of client-server architectures. Oracle Berkeley DB eliminates the overhead of SQL query processing, enabling applications with predictable access patterns to run faster."

Before starting, please check to see if there is a latest version available to download. Visit http://www.oracle.com/technology/products/berkeley-db/db/index.html to find out about the available versions. IMPORTANT: See "Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install BerkeleyDB from source code.

Steps to download, compile, and install are as follows. Note: Replace 4.3.29 with your version number:

  • Downloading Berkeley DB:

    Run the command below,

    wget http://downloads.sleepycat.com/db-4.3.29.tar.gz

    Also, download the MD5 hash to verify the integrity of the downloaded file. In the same folder, where you downloaded the Oracle Berkeley DB file, do the following:

    wget http://downloads.sleepycat.com/db-4.3.29.tar.gz.md5
    md5sum db-4.3.29.tar.gz
    cat db-4.3.29.tar.gz.md5

    The last two commands (above) generate two strings of alpha-numeric characters. Check to see if both strings are identical or not. If not, repeat the steps above from "Downloading Berkeley DB". If yes, your file has been downloaded properly. Please note that if you are using Berkeley DB for a highly secure/critical setup (or for any other reason) then you should also check the PGP signatures (not covered in this tutorial for simplicity).

  • Extracting files from the downloaded package:

    tar –xvzf db-4.3.29.tar.gz

    Now, enter the directory where the package is extracted.

    cd db-4.3.29

  • Configuring Berkeley DB:

    Steps below are mandatory for installation on POSIX systems (linux, mac os x etc.). You should also read the documentation that comes in the folder "docs" of Berkeley DB.

    cd build_unix
    ../dist/configure --prefix=/usr/local/berkeleydb --enable-compat185 --enable-cxx --enable-debug_rop --enable-debug_wop --enable-rpc

    Replace "/usr/local/berkeleydb" above with the directory path where you want to copy the files and folders. Note: check for any error message.
  • Compiling Berkeley DB:

    make

    Note: check for any error message.

  • Installing Berkeley DB:

    As root (for privileges on destination directory), run the following.

    With sudo,

    sudo make install

    Without sudo,

    make install

    Note: check for any error messages.

  • More Configuration:

    echo '/usr/local/berkeleydb/lib/' >> /etc/ld.so.conf
    ldconfig

That’s it. Berkeley DB has been successfully installed.

Did this tutorial help a little? How about buy me a cup of coffee?

Buy me a coffee at ko-fi.com

Please feel free to use the comments form below if you have any questions or need more explanation on anything. I do not guarantee a response.

IMPORTANT: You must thoroughy test any instructions on a production-like test environment first before trying anything on production systems. And, make sure it is tested for security, privacy, and safety. See our terms here.

Comments (write a comment):

Dear Admin,

I have followed above mentioned steps.
And I have checked there no error during installation.

After installation, I have tried, to connect "dbxml" by entering the "dbxml" command in the terminal. It will shows the the following message

"dbxml: command not found".

Please tell me what mistake I did.

I am new for "Berkeley DBXML".

I am eagerly waiting for your answer.

Thanks in advance. Posted by: Ramakrishna on Jul 23, 2014

@Ramakrishna: the instructions are quite old now, so you may need to look at the documentation to find the answer to your questions.

I will look into it when I have some free time (not sure when). Posted by: shahryar on Sep 02, 2014

leave a comment on tutorial leave a comment