sudo apt update
sudo apt install wget gcc build-essential

cd /usr/local/src

sudo wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

Now Let's Tar The File:

sudo tar zxvf db-4.8.30.NC.tar.gz

Now cd Into The Following Dir:

cd db-4.8.30.NC/build_unix/

Now Run Each Line One At A Time:

../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/opt/db-4.8.30

sudo make

sudo make install
To Fix The Error, Do The Following If Needed:

cd db-4.8.30.NC/dbinc

sudo nano atomic.h

Once In File Edit The Following Two Lines:

Line 147:

From:  __atomic_compare_exchange((p), (o), (n)) 
To: __atomic_compare_exchange_db((p), (o), (n))

Line 179:

From: static inline int __atomic_compare_exchange( 
To: static inline int __atomic_compare_exchange_db(