<p>You can follow the instructions for Debian at the build docs: </p>

<p><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>

<p>For Berkely DB, specifically:</p>

<p>Berkeley DB</p>

<hr>

<p>It is recommended to use Berkeley DB 4.8. If you have to build it yourself,</p>

<p>you can use <a href="/contrib/install_db4.sh">the installation script included in contrib/</a></p>

<p>like so:</p>



<pre><code>
./contrib/install_db4.sh `pwd`

</code></pre>

<p>from the root of the repository.</p>

<p><strong>Note</strong>: You only need Berkeley DB if the wallet is enabled (see <a href="/doc/build-unix.md#disable-wallet-mode"><em>Disable-wallet mode</em></a>).</p>

CC BY-SA 4.0
2019-05-24T15:31:41.797Z
To be able to `make` with just 1GB I needed to use a 4GB swap: `fallocate -l 4G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && swapon --show` (https://github.com/bitcoin/bitcoin/issues/11820)
bomben
CC BY-SA 4.0
2019-05-24T05:21:45.453Z
2019-05-24T05:21:45.453Z
JBaczuk
<p>Following parts of <a href="https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1" rel="nofollow noreferrer">this</a> guide I was able to install a <strong>full node with wallet (without GUI)</strong> on my already running Raspberry Pi. I did not use all of the steps.</p>

<p>I did use my external hdd as swap:</p>

<pre><code>sudo swapoff --all
sudo nano /etc/dphys-swapfile
</code></pre>

<p>Putting in the following</p>

<pre><code>CONF_SWAPFILE=/mnt/hdd/swap
#CONF_SWAPSIZE=100
CONF_SWAPFACTOR=2
</code></pre>

<p>But I had to add <a href="https://github.com/bitcoin/bitcoin/issues/11820" rel="nofollow noreferrer">this</a> (as root) to make configuring work: </p>

<pre><code>fallocate -l 4G /swapfile &amp;&amp; chmod 600 /swapfile &amp;&amp; mkswap /swapfile &amp;&amp; swapon /swapfile &amp;&amp; swapon --show
</code></pre>

<p>(It is also possible that the guide just missed the <code>swapon --all</code> after configuring <code>/etc/dphys-swapfile</code>.)</p>

<p>I installed dependencies according to the guide:</p>

<pre><code>sudo apt install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libminiupnpc-dev libzmq3-dev jq
</code></pre>

<p>But I have to say that I already installed a lot and probably more dependencies from the bitcoin github site.</p>

<p>I did <code>./contrib/install_db4.sh $(pwd)</code> to install <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db" rel="nofollow noreferrer">Berkeley DB 4.8</a>.</p>

<p>I used the git I already cloned (in <code>/home/Downloads/bin/bitcoin</code>).</p>

<p>This was something I missed during the first attemps: <code>./autogen.sh</code>.</p>

<p>Then I <code>export BDB_PREFIX=$(pwd)/db4</code> (I am actually not sure if I did this first part which is included in the guide and is setting a variable which is used in the <code>./configure</code> if I understand correctly.) But I definitely did</p>

<pre><code>./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --enable-cxx --without-gui --disable-shared --with-pic --enable-upnp-default
</code></pre>

<p>And then of course (which might take a few hours)</p>

<pre><code>make
sudo make install
</code></pre>

<p>This time I had no errors and no hangs while configuring.</p>

<p>I also added the bitcoin user and a firewall as decribed in the guide. In my case I had to open up more ports for the firewall because my Raspberry is running other stuff too (SMB, LMS, minidlna).</p>

CC BY-SA 4.0
2019-05-28T06:20:23.953Z
2019-05-28T10:07:47.217Z
2019-05-28T10:07:47.217Z
bomben
<p>I want to use this <a href="http://www.raspberrypifullnode.com/" rel="nofollow noreferrer">guide</a> to set up a headless bitcoin core full node and came across the line:</p>

<pre><code>./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --disable-wallet
</code></pre>

<p>Unfortunately, the blog does not explain why he uses this.</p>

<p>First of all, I want to use my node <strong>with wallet</strong>. Second, I want to configure it to be usefull with a Raspberry Pi which has only <strong>1GB of RAM</strong> and is also running other stuff, for example my Logitech Media Server for audio streaming. So I would like to make the node as lean as possible.</p>

<p>I know that I can use a config file for running  <code>bitcoind</code> with entries for upload limit and other setups. Do I need to run the skript also with options or are both setups interchangeably?</p>

<p>Also, I get the error <code>Found Berkeley DB other than 4.8</code> upon configure. Can Ihave a wallet with the BDB other than 4.8? The error message suggests, that 4.8 is needed for "portable wallets". </p>

<p><a href="http://www.raspberrypifullnode.com/" rel="nofollow noreferrer">Here</a> I found out about dependencies for the wallet and also about the option to built without GUI. Unfortunately, I cannot successfully <code>./configure</code> with those neither, because BDB 4.8 is also not found this way.</p>

<p>However, to do it without GUI the option <code>--without-gui</code>can be used, which is very usefull.</p>

<hr>

<p><strong>EDIT: I encountered another problem while <code>make</code>:</strong></p>

<pre><code>/usr/bin/ld: cannot find -ldb_cxx-4.8
collect2: error: ld returned 1 exit status
Makefile:4779: die Regel für Ziel „bitcoind“ scheiterte
make[2]: *** [bitcoind] Fehler 1
make[2]: Verzeichnis „/home/pi/Downloads/bin/bitcoin/src“ wird verlassen
Makefile:12975: die Regel für Ziel „all-recursive“ scheiterte
make[1]: *** [all-recursive] Fehler 1
make[1]: Verzeichnis „/home/pi/Downloads/bin/bitcoin/src“ wird verlassen
Makefile:776: die Regel für Ziel „all-recursive“ scheiterte
make: *** [all-recursive] Fehler 1
19:07:10 [pi@raspberrypi bitcoin]$ /usr/bin/ld: cannot find -ldb_cxx-4.8
-bash: /usr/bin/ld:: Datei oder Verzeichnis nicht gefunden
</code></pre>

<p><a href="https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary">Here</a> I found an answer to a related error and I used <code>ld -ldb_cxx-4.8 --verbose</code> and got this:</p>

<pre><code>attempt to open //usr/local/lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //usr/local/lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //usr/lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //usr/lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //usr/local/lib/libdb_cxx-4.8.so failed
attempt to open //usr/local/lib/libdb_cxx-4.8.a failed
attempt to open //lib/libdb_cxx-4.8.so failed
attempt to open //lib/libdb_cxx-4.8.a failed
attempt to open //usr/lib/libdb_cxx-4.8.so failed
attempt to open //usr/lib/libdb_cxx-4.8.a failed
attempt to open //usr/arm-linux-gnueabihf/lib/libdb_cxx-4.8.so failed
attempt to open //usr/arm-linux-gnueabihf/lib/libdb_cxx-4.8.a failed
ld: cannot find -ldb_cxx-4.8
</code></pre>

<p>Now trying with <code>sudo apt-get install gcc-4.8 g++-4.8</code>. That did not help.</p>

<p>Maybe I have to try this guide: <a href="https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1" rel="nofollow noreferrer">https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1</a></p>

CC BY-SA 4.0
2019-05-23T14:46:07.840Z
I want to add that with wallet it is necessary to `sudo apt-get install libdb++-dev`.
bomben
CC BY-SA 4.0
2019-05-23T15:26:24.690Z
You might find this helpful https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian
JBaczuk
CC BY-SA 4.0
2019-05-23T19:52:09.323Z
Yes, I found it, but unfortunately, it sais nothing about how to compile a debian version that includes BDB 4.8. It just sais: "Ubuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install BerkeleyDB 5.1 or later."
bomben
CC BY-SA 4.0
2019-05-23T20:33:57.910Z
Have you tried https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db
JBaczuk
CC BY-SA 4.0
2019-05-24T04:01:30.987Z
As `configure` worked, `make` now takes quite a while at  `CXX      libbitcoin_server_a-init.o`. Not sure if the process crashed or if it is just hard work for a small CPU.
bomben
CC BY-SA 4.0
2019-05-24T05:07:22.233Z
Yes if I remember correctly I ran into that issue as well when I didn't have enough memory.
JBaczuk
CC BY-SA 4.0
2019-05-24T12:25:05.667Z
If it doesn't crash it's probably still compiling... Good luck!
JBaczuk
<bitcoind><raspberry-pi>
How to ./configure a built for Raspberry Pi?
bomben
# How to ./configure a built for Raspberry Pi?

(Asked by: username_0 on 2019-05-23)

I want to use this [guide](http://www.raspberrypifullnode.com/) to set up a headless bitcoin core full node and came across the line:

```
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --disable-wallet

```

Unfortunately, the blog does not explain why he uses this.

First of all, I want to use my node **with wallet**. Second, I want to configure it to be usefull with a Raspberry Pi which has only **1GB of RAM** and is also running other stuff, for example my Logitech Media Server for audio streaming. So I would like to make the node as lean as possible.

I know that I can use a config file for running `bitcoind` with entries for upload limit and other setups. Do I need to run the skript also with options or are both setups interchangeably?

Also, I get the error `Found Berkeley DB other than 4.8` upon configure. Can Ihave a wallet with the BDB other than 4.8? The error message suggests, that 4.8 is needed for "portable wallets".

[Here](http://www.raspberrypifullnode.com/) I found out about dependencies for the wallet and also about the option to built without GUI. Unfortunately, I cannot successfully `./configure` with those neither, because BDB 4.8 is also not found this way.

However, to do it without GUI the option `--without-gui`can be used, which is very usefull.

---

**EDIT: I encountered another problem while `make`:**

```
/usr/bin/ld: cannot find -ldb_cxx-4.8
collect2: error: ld returned 1 exit status
Makefile:4779: die Regel für Ziel „bitcoind“ scheiterte
make[2]: *** [bitcoind] Fehler 1
make[2]: Verzeichnis „/home/pi/Downloads/bin/bitcoin/src“ wird verlassen
Makefile:12975: die Regel für Ziel „all-recursive“ scheiterte
make[1]: *** [all-recursive] Fehler 1
make[1]: Verzeichnis „/home/pi/Downloads/bin/bitcoin/src“ wird verlassen
Makefile:776: die Regel für Ziel „all-recursive“ scheiterte
make: *** [all-recursive] Fehler 1
19:07:10 [pi@raspberrypi bitcoin]$ /usr/bin/ld: cannot find -ldb_cxx-4.8
-bash: /usr/bin/ld:: Datei oder Verzeichnis nicht gefunden

```

[Here](https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary) I found an answer to a related error and I used `ld -ldb_cxx-4.8 --verbose` and got this:

```
attempt to open //usr/local/lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //usr/local/lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //usr/lib/arm-linux-gnueabihf/libdb_cxx-4.8.so failed
attempt to open //usr/lib/arm-linux-gnueabihf/libdb_cxx-4.8.a failed
attempt to open //usr/local/lib/libdb_cxx-4.8.so failed
attempt to open //usr/local/lib/libdb_cxx-4.8.a failed
attempt to open //lib/libdb_cxx-4.8.so failed
attempt to open //lib/libdb_cxx-4.8.a failed
attempt to open //usr/lib/libdb_cxx-4.8.so failed
attempt to open //usr/lib/libdb_cxx-4.8.a failed
attempt to open //usr/arm-linux-gnueabihf/lib/libdb_cxx-4.8.so failed
attempt to open //usr/arm-linux-gnueabihf/lib/libdb_cxx-4.8.a failed
ld: cannot find -ldb_cxx-4.8

```

Now trying with `sudo apt-get install gcc-4.8 g++-4.8`. That did not help.

Maybe I have to try this guide: <https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1>

**Tags:** bitcoind, raspberry-pi

> **Comments:**
> **username_0**: I want to add that with wallet it is necessary to `sudo apt-get install libdb++-dev`.  
> **username_1**: You might find this helpful https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#ubuntu--debian  
> **username_0**: Yes, I found it, but unfortunately, it sais nothing about how to compile a debian version that includes BDB 4.8. It just sais: "Ubuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install BerkeleyDB 5.1 or later."  
> **username_1**: Have you tried https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db  
> **username_0**: As `configure` worked, `make` now takes quite a while at  `CXX      libbitcoin_server_a-init.o`. Not sure if the process crashed or if it is just hard work for a small CPU.  
> **username_1**: Yes if I remember correctly I ran into that issue as well when I didn't have enough memory.  
> **username_1**: If it doesn't crash it's probably still compiling... Good luck!  

---

## 2 answers

### Answer by username_1 on 2019-05-24. Score: 1 | Accepted answer

You can follow the instructions for Debian at the build docs:

<https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md>

For Berkely DB, specifically:

Berkeley DB

---

It is recommended to use Berkeley DB 4.8. If you have to build it yourself,

you can use [the installation script included in contrib/](/contrib/install_db4.sh)

like so:

```

./contrib/install_db4.sh `pwd`

```

from the root of the repository.

**Note**: You only need Berkeley DB if the wallet is enabled (see [*Disable-wallet mode*](/doc/build-unix.md#disable-wallet-mode)).

> **Comments:**
> **username_0**: To be able to `make` with just 1GB I needed to use a 4GB swap: `fallocate -l 4G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && swapon --show` (https://github.com/bitcoin/bitcoin/issues/11820)  

---

### Answer by username_0 on 2019-05-28. Score: 0

Following parts of [this](https://medium.com/@meeDamian/bitcoin-full-node-on-rbp3-revised-88bb7c8ef1d1) guide I was able to install a **full node with wallet (without GUI)** on my already running Raspberry Pi. I did not use all of the steps.

I did use my external hdd as swap:

```
sudo swapoff --all
sudo nano /etc/dphys-swapfile

```

Putting in the following

```
CONF_SWAPFILE=/mnt/hdd/swap
#CONF_SWAPSIZE=100
CONF_SWAPFACTOR=2

```

But I had to add [this](https://github.com/bitcoin/bitcoin/issues/11820) (as root) to make configuring work:

```
fallocate -l 4G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && swapon --show

```

(It is also possible that the guide just missed the `swapon --all` after configuring `/etc/dphys-swapfile`.)

I installed dependencies according to the guide:

```
sudo apt install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libminiupnpc-dev libzmq3-dev jq

```

But I have to say that I already installed a lot and probably more dependencies from the bitcoin github site.

I did `./contrib/install_db4.sh $(pwd)` to install [Berkeley DB 4.8](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db).

I used the git I already cloned (in `/home/Downloads/bin/bitcoin`).

This was something I missed during the first attemps: `./autogen.sh`.

Then I `export BDB_PREFIX=$(pwd)/db4` (I am actually not sure if I did this first part which is included in the guide and is setting a variable which is used in the `./configure` if I understand correctly.) But I definitely did

```
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --enable-cxx --without-gui --disable-shared --with-pic --enable-upnp-default

```

And then of course (which might take a few hours)

```
make
sudo make install

```

This time I had no errors and no hangs while configuring.

I also added the bitcoin user and a firewall as decribed in the guide. In my case I had to open up more ports for the firewall because my Raspberry is running other stuff too (SMB, LMS, minidlna).


---

