<p>Try installing the correct version of BerkleyDB. (4.8) I have the correct .debs in this repository: </p>

<p><a href="http://github.com/nickodell/build_bitcoin" rel="nofollow">http://github.com/nickodell/build_bitcoin</a></p>

<p>You may need to uninstall the newer version of libdb first.</p>

CC BY-SA 3.0
2015-05-19T01:51:26.220Z
2015-05-19T08:22:03.070Z
2015-05-19T08:22:03.070Z
Nick ODell
<p>From Bitcoin Core's <a href="https://github.com/bitcoin/bitcoin/tree/master/src/test" rel="nofollow">test directory</a> (<code>bitcoin/src/test</code>), the executable <code>test_bitcoin</code> is supposed to run the unit tests. When I run <code>test_bitcoin</code>, however, I get:</p>

<pre><code>replication requires locking support
Test setup error: std::runtime_error: CDBEnv::MakeMock : Error 22 opening database environment.
</code></pre>

<p>How can I run <code>test_bitcoin</code>? I installed Bitcoin from source.</p>

<p><strong>Also</strong>:</p>

<p>I ran <code>configure</code> using the <code>--with-incompatible-bdb</code> flag.</p>

CC BY-SA 3.0
2015-05-17T00:32:16.097Z
Why don't you install the correct version of bdb? I have the correct .debs in this repository: https://github.com/nickodell/build_bitcoin Does that fix it?
Nick ODell
CC BY-SA 3.0
2015-05-18T21:47:33.727Z
@NickODell When I run `build.sh` I get: `dpkg: regarding .../libdb4.8-dev_4.8.24-1ubuntu1_i386.deb containing libdb4.8-dev:
 libdb5.3-dev conflicts with libdb4.8-dev
  libdb4.8-dev (version 4.8.24-1ubuntu1) is to be installed.
`
DJG
CC BY-SA 3.0
2015-05-18T21:49:23.903Z
It's complaining that you already have a different version of libdb installed.
Nick ODell
CC BY-SA 3.0
2015-05-19T00:44:05.770Z
@NickODell I got it to work by uninstalling libdb5.3. I also had to reinstall the 64 bit version of libdb4.8-dev due to some packaging problem, but now it is working. Thanks! Also: how should this be written up as an answer so that users can see that this question already has been answered?
DJG
<ubuntu><bitcoin-core-development><testing>
Trouble running bitcoin unit tests with test_bitcoin on Ubuntu
DJG
# Trouble running bitcoin unit tests with test_bitcoin on Ubuntu

(Asked by: username_0 on 2015-05-16)

From Bitcoin Core's test directory (bitcoin/src/test), the executable test_bitcoin is supposed to run the unit tests. When I run test_bitcoin, however, I get:
replication requires locking support
Test setup error: std::runtime_error: CDBEnv::MakeMock : Error 22 opening database environment.

How can I run test_bitcoin? I installed Bitcoin from source.
Also:
I ran configure using the --with-incompatible-bdb flag.

**Tags:** ubuntu, bitcoin-core-development, testing

> **Comments:**
> **username_1**: Why don't you install the correct version of bdb? I have the correct .debs in this repository: https://github.com/nickodell/build_bitcoin Does that fix it?  
> **username_0**: @NickODell When I run `build.sh` I get: `dpkg: regarding .../libdb4.8-dev_4.8.24-1ubuntu1_i386.deb containing libdb4.8-dev:  libdb5.3-dev conflicts with libdb4.8-dev   libdb4.8-dev (version 4.8.24-1ubuntu1) is to be installed. `  
> **username_1**: It's complaining that you already have a different version of libdb installed.  
> **username_0**: @NickODell I got it to work by uninstalling libdb5.3. I also had to reinstall the 64 bit version of libdb4.8-dev due to some packaging problem, but now it is working. Thanks! Also: how should this be written up as an answer so that users can see that this question already has been answered?  

---

## 1 answers

### Answer by username_1 on 2015-05-19. Score: 1 | Accepted answer

Try installing the correct version of BerkleyDB. (4.8) I have the correct .debs in this repository:

<http://github.com/nickodell/build_bitcoin>

You may need to uninstall the newer version of libdb first.


---

