<p>I found a solution <a href="https://88plug.com/linux/install-berkeley-4-8-db-libs-on-ubuntu-16-04/" rel="nofollow noreferrer">here</a> with:</p>

<pre><code>sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
</code></pre>

<hr>

<p>Also, <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=216846" rel="nofollow noreferrer">this</a> says:</p>

<blockquote>
  <p>The newer libdb should work on most coin daemons, the issue you might find is that the database files (wallet.dat in particular) isn't compatible with all other systems if they're built on an older libdb.</p>
</blockquote>

<p>That corresponds to the following line from the bitcoin core github:</p>

<blockquote>
  <p>This will break binary wallet compatibility with the distributed executables, which are based on BerkeleyDB 4.8.</p>
</blockquote>

<p>So, having a newer BerkeleyDB is only a problem, if you want to use your <code>wallet.dat</code> on another system and this other system happens to use BerkeleyDB 4.8 - which is the case for the <code>bitcoind</code> executables which are downloadable from the project itself. </p>

<p>But if you only use the wallet on your own system or, if you migrate it, you use a system with the newer BerkeleyDB also, then there should be no problems. </p>

CC BY-SA 4.0
2019-11-24T19:26:11.960Z
2019-11-24T19:49:51.440Z
2019-11-24T19:49:51.440Z
bomben
<p>You can compile it using this script in the Bitcoin Core repository:
<a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/install_db4.sh" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/contrib/install_db4.sh</a> . It will give you instructions about how to then <code>./configure</code> with this compiled version in order to build the project.</p>
<p>Instructions about building Bitcoin Core are available in the <a href="https://github.com/bitcoin/bitcoin/tree/master/doc" rel="nofollow noreferrer"><code>/doc</code></a> folder, for Unix systems it is at
<a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md</a></p>

CC BY-SA 4.0
2020-12-14T14:58:10.633Z
2021-01-13T15:14:37.437Z
2021-01-13T15:14:37.437Z
droid192
<p>The script install_db4.sh was removed from v25.
But you can find it in v24:
<a href="https://github.com/bitcoin/bitcoin/blob/24.x/contrib/install_db4.sh" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/24.x/contrib/install_db4.sh</a></p>

CC BY-SA 4.0
2024-05-25T18:43:44.370Z
2024-05-25T18:43:44.370Z
Sergio Nieto García
<p><code>brew install berkeley-db@4</code> worked for me</p>

CC BY-SA 4.0
2021-06-14T02:28:30.587Z
2021-06-14T02:38:08.333Z
2021-06-14T02:38:08.333Z
Arush Srivastava
<p>this fixed my problem in kali
i used
sudo apt install libdb
and then pip install bsddb3 and it was able to find the local berkely installation and complete the install
thanks soo much</p>

CC BY-SA 4.0
2023-03-08T02:51:02.507Z
2023-03-08T02:53:22.857Z
2023-03-08T02:53:22.857Z
Robert G
<p>The <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md" rel="nofollow noreferrer">Unix build notes</a> do not show how to install version 4.8 apart from saying </p>

<blockquote>
  <p>BerkeleyDB is required for the wallet. Ubuntu and Debian have their 
      own libdb-dev and libdb++-dev packages, but these will install 
      BerkeleyDB 5.1 or later. This will break binary wallet compatibility 
      with the distributed executables, which are based on BerkeleyDB 4.8.If you do not care about wallet compatibility, pass --with-incompatible-bdb to configure. Otherwise, you can build from self-compiled depends (see above).</p>
</blockquote>

<p>The referenced <a href="https://github.com/bitcoin/bitcoin/blob/master/depends/README.md" rel="nofollow noreferrer">README.md</a> from the quoted </p>

<blockquote>
  <p>Now, you can either build from self-compiled depends or install the
  required dependencies:</p>
</blockquote>

<p>does not discuss BerkeleyDB 4.8.</p>

<p>I know there is <code>./contrib/install_db4.sh</code> in the source for installing BerkeleyDB 4.8 but it abords on my Ubuntu with <code>curl: (7) Failed to connect to git.savannah.gnu.org port 443: No route to host</code>.</p>

<bitcoin-core><bitcoind><linux>
How to install Berkeley DB 4.8 on Linux?
bomben
# How to install Berkeley DB 4.8 on Linux?

(Asked by: username_0 on 2019-11-24)

The [Unix build notes](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md) do not show how to install version 4.8 apart from saying

> BerkeleyDB is required for the wallet. Ubuntu and Debian have their
> own libdb-dev and libdb++-dev packages, but these will install
> BerkeleyDB 5.1 or later. This will break binary wallet compatibility
> with the distributed executables, which are based on BerkeleyDB 4.8.If you do not care about wallet compatibility, pass --with-incompatible-bdb to configure. Otherwise, you can build from self-compiled depends (see above).

The referenced [README.md](https://github.com/bitcoin/bitcoin/blob/master/depends/README.md) from the quoted

> Now, you can either build from self-compiled depends or install the
> required dependencies:

does not discuss BerkeleyDB 4.8.

I know there is `./contrib/install_db4.sh` in the source for installing BerkeleyDB 4.8 but it abords on my Ubuntu with `curl: (7) Failed to connect to git.savannah.gnu.org port 443: No route to host`.

**Tags:** bitcoin-core, bitcoind, linux


---

## 5 answers

### Answer by username_0 on 2019-11-24. Score: 1 | Accepted answer

I found a solution here with:
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev


Also, this says:

The newer libdb should work on most coin daemons, the issue you might find is that the database files (wallet.dat in particular) isn't compatible with all other systems if they're built on an older libdb.

That corresponds to the following line from the bitcoin core github:

This will break binary wallet compatibility with the distributed executables, which are based on BerkeleyDB 4.8.

So, having a newer BerkeleyDB is only a problem, if you want to use your wallet.dat on another system and this other system happens to use BerkeleyDB 4.8 - which is the case for the bitcoind executables which are downloadable from the project itself. 
But if you only use the wallet on your own system or, if you migrate it, you use a system with the newer BerkeleyDB also, then there should be no problems.


---

### Answer by username_1 on 2020-12-14. Score: 3

You can compile it using this script in the Bitcoin Core repository:
<https://github.com/bitcoin/bitcoin/blob/master/contrib/install_db4.sh> . It will give you instructions about how to then `./configure` with this compiled version in order to build the project.

Instructions about building Bitcoin Core are available in the [`/doc`](https://github.com/bitcoin/bitcoin/tree/master/doc) folder, for Unix systems it is at
<https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md>


---

### Answer by username_2 on 2024-05-25. Score: 0

The script install\_db4.sh was removed from v25.
But you can find it in v24:
<https://github.com/bitcoin/bitcoin/blob/24.x/contrib/install_db4.sh>


---

### Answer by username_3 on 2021-06-14. Score: -1

`brew install berkeley-db@4` worked for me


---

### Answer by username_4 on 2023-03-08. Score: -1

this fixed my problem in kali
i used
sudo apt install libdb
and then pip install bsddb3 and it was able to find the local berkely installation and complete the install
thanks soo much


---

