Litecoin and Bitcoin Cores: compiling Berkeley DB 4.8 and
build Litcoin core (2026-01-06)
1. Download source from github:
https://github.com/litecoin-project/litecoin
2. Download boost dependency
cd depends
make
(this will fail on Berkely because some current include file doesn't match)
3. Download Berkley DB 4.8 from Oracle (via github)
https://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
via https://github.com/observerdev/db-4.8.30
4. Compile Berkeley DB 4.8 and install. Without this, old wallets will not be usable.
a. cd build_unix
b. ../dist/configure --enable-cxx
If you do not include --enable-cxx, the lightcoin tree will not compile
and will fail with the complaint that iostream.h is not available.
c. vi ../dbinc/atomic.h
add "_db" to the two instances of __atomic_compare_exchange, on lines 147 and 179
This resolves a naming conflict that the BDB developers created with a standard
g++ function of the same name. Thanks to
https://fuzzthepiguy.tech/db-berkeley/
c. make
d. make install
5. Install QT5, which is older than the version on 24.04. Without this, the gui will not be built.
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools
https://deepwiki.com/litecoin-project/litecoin/9.2-building-on-different-platforms
6. Configure Litcoin core source
./configure BDB_LIBS=/usr/local/BerkeleyDB.4.8/lib BDB_CFLAGS=/usr/local/BerkeleyDB.4.8/include
vi src/Makefile (the variable BDB_CPPFLAGS isn't configured with a -I in front of it
and BDB_LIBS doesn't have the -L and also doesn't list the library to link against)
BDB_CPPFLAGS: add -I and -L before /usr/local/BerkeleyDB.4.8/include and ../lib :
BDB_CPPFLAGS = -I/usr/local/BerkeleyDB.4.8/include
BDB_LIBS = -L/usr/local/BerkeleyDB.4.8/lib -ldb_cxx
7. make
8. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/BerkeleyDB.4.8/lib
make check
9. make install