<p>Ok it seems you are running on Debian Jessie. No you cannot simply do <code>sudo apt-get ...</code>. You can either download the binaries from somewhere, or you can build the binaries from source. I personally would advise you to build the application from source, as it is a great learning exercise. It is also safer in principle to personally ensure the program you are running is really tied to the open source code which has been released. </p>

<p>One of the difficulties of building bitcoin core from source is to make sure all dependencies are correctly installed first. In particular, if you want to use a wallet as part of the software <strong>you need to build the Berkeley Database version <code>4.8.30</code></strong>.</p>

<p>Download the file <code>db-4.8.30.NC.tar.gz</code> from <a href="http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html" rel="nofollow noreferrer">this page</a>. Check the hash of the downloaded file:</p>

<pre><code>$ sha256sum db-4.8.30.NC.tar.gz
12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef
</code></pre>

<p>Then uncompressed the archive:</p>

<pre><code>$ tar -xvf db-4.8.30.NC.tar.gz 
</code></pre>

<p>Before stepping inside the newly created directory, create a directory <code>db4</code> for the sake of installing the Berkeley database:</p>

<pre><code>$ BDB_PREFIX="$(pwd)/db4"
$ mkdir $BDB_PREFIX
</code></pre>

<p>So we can now build the Berkeley database as follows:</p>

<pre><code>$ cd db-4.8.30.NC/build_unix
$ ../dist/configure --enable-cxx \
                    --disable-shared \
                    --with-pic \
                    --prefix=$BDB_PREFIX
$ make install
</code></pre>

<p>Note that <code>make install</code> does not require super user rights, since the project is configured with a <code>--prefix</code> option which means the binaries
are installed in a file system hierarchy which you own. Once <code>make install</code> terminates, you can check that your <code>db4</code> directory has been duly set up with <code>bin</code> <code>docs</code> <code>include</code> and <code>lib</code> sub-directories.</p>

<p>Having installed the Berkeley database, <strong>you can now focus on building bitcoin core</strong> (and its other dependencies which are easier to install). First install the official bitcoin source repository:</p>

<pre><code>$ git clone https://github.com/bitcoin/bitcoin.git
</code></pre>

<p>Then move to the bitcoin directory:</p>

<pre><code>$ cd bitcoin
</code></pre>

<p>Check the available version tags:</p>

<pre><code>$ git tag
</code></pre>

<p>Synchronize your local code with the version you want:</p>

<pre><code>$ git checkout v0.13.2 
</code></pre>

<p><strong>From this point on, everything is explained in the file <code>doc/build-unix.md</code></strong> I am repeating things here for emphasis, as it may bring light on a few points, but this post will be out of date soon and you should really refer to <code>doc/build-unix</code>. </p>

<p>Add the following line to your file <code>/etc/apt/sources.list</code> with the right mirror:</p>

<pre><code>deb http://[mirror]/debian oldstable main
</code></pre>

<p>Then:</p>

<pre><code>$ sudo apt-get update
</code></pre>

<p>Then install the packages described in <code>doc/build-unix.md</code> (build requirement). When it comes to boost, hopefully the debian repository version is enough:</p>

<pre><code>$ sudo apt-get install libboost-all-dev
</code></pre>

<p>As indicated in the file, also install these packages:</p>

<pre><code>$ sudo apt-get install libminiupnpc-dev

$ sudo apt-get install libzmq3-dev
</code></pre>

<p>At this stage, you need to install the GUI dependencies as per file.</p>

<p>Once this is done you can start the build. However, you will need to refer to your <code>db4</code> directory created while building the Berkeley database version <code>4.8.30</code>. The simplest option is to create a link:</p>

<pre><code>$ ln -s ~/path-to/db4 db4
</code></pre>

<p><strong>Then the build can start:</strong></p>

<pre><code>$ ./autogen.sh
$ ./configure LDFLAGS="-L/path-to/bitcoin/db4/lib/" \
              CPPFLAGS="-I/path-to/bitcoin/db4/include/"
$ make
$ make check 
$ sudo make install
</code></pre>

<p>Your software should be installed now, and you can check this is the case:</p>

<pre><code>$ which bitcoind
$ which bitcoin-qt
$ which bitcoin-cli
</code></pre>

<p><strong>Note</strong>: since you already have <code>v0.12.0</code> running, you should have a directory <code>~/.bitcoin</code> with your config file, debug file, wallet file,  blockchain data etc. Your new installed version should pick things up from there (in particular you will not need to sync the blockchain again).</p>

CC BY-SA 3.0
2017-02-09T17:00:35.350Z
I was kind of afraid the answer might be something like this. My problem with doing downloads (even aside from builds) is that there are core updates 4-5 times every year. I don't really want to be investing hours of my time every year doing one update after another. After all, what is this supposed to be, Microsoft Windows?
Harry Pillsbury
CC BY-SA 3.0
2017-02-09T17:09:47.707Z
@Tyler, you are entitled to your own choice. However, if I may share my own experience, I was totally new to Linux not so long ago and I used to feel overwhelmed at the prospect of upgrading. Now I am so glad I invested in understanding the process. I find it so gratifying when it all works. I am now enjoying every new upgrade and it is very quick. My guess is that if you make that investment, you'll be as glad as I am. Note that upgrading is easier: `git pull` , check the new tags, `git checkout <version>` etc... you don't need to re-install dependencies.
Sven Williamson
CC BY-SA 3.0
2017-02-09T16:52:55.447Z
2017-02-09T17:00:32.487Z
2017-02-09T17:00:32.487Z
Sven Williamson
<p>I am currently running 120100 bitcoind. Apparently, the software is now at 130200. What is the procedure for updating? Can I just do:</p>

<pre><code>sudo apt-get upgrade bitcoind
</code></pre>

<p>or is it more complicated than that? Operating System is Debian 3.16</p>

<p>(This box does not have a wallet and is only used for getting information from the blockchain, so I do not need any strict security protocols.)</p>

CC BY-SA 3.0
2017-02-09T18:26:18.450Z
How did you install Bitcoin Core 0.12.1? Just repeat the procedure.
Pieter Wuille
CC BY-SA 3.0
2017-02-09T18:29:12.357Z
@PieterWuille That was a year ago and I don't remember what I did, only that it took a long time. Since the core has been updated 4 or 5 times since then, I am hoping there is an upgrade facility I can use without having to repeat a long-winded installation procedure 5 times a year.
Harry Pillsbury
CC BY-SA 3.0
2017-02-09T19:11:23.180Z
You can just download the new binary and replace the old one, if you don't want to compile from scratch.
Pieter Wuille
<installation>
Update (or is it an upgrade?) from 12.0 to 13.2
Harry Pillsbury
# Update (or is it an upgrade?) from 12.0 to 13.2

(Asked by: username_0 on 2017-02-09)

I am currently running 120100 bitcoind. Apparently, the software is now at 130200. What is the procedure for updating? Can I just do:

```
sudo apt-get upgrade bitcoind

```

or is it more complicated than that? Operating System is Debian 3.16

(This box does not have a wallet and is only used for getting information from the blockchain, so I do not need any strict security protocols.)

**Tags:** installation

> **Comments:**
> **username_1**: How did you install Bitcoin Core 0.12.1? Just repeat the procedure.  
> **username_0**: @username_1 That was a year ago and I don't remember what I did, only that it took a long time. Since the core has been updated 4 or 5 times since then, I am hoping there is an upgrade facility I can use without having to repeat a long-winded installation procedure 5 times a year.  
> **username_1**: You can just download the new binary and replace the old one, if you don't want to compile from scratch.  

---

## 1 answers

### Answer by username_2 on 2017-02-09. Score: 1

Ok it seems you are running on Debian Jessie. No you cannot simply do `sudo apt-get ...`. You can either download the binaries from somewhere, or you can build the binaries from source. I personally would advise you to build the application from source, as it is a great learning exercise. It is also safer in principle to personally ensure the program you are running is really tied to the open source code which has been released.

One of the difficulties of building bitcoin core from source is to make sure all dependencies are correctly installed first. In particular, if you want to use a wallet as part of the software **you need to build the Berkeley Database version `4.8.30`**.

Download the file `db-4.8.30.NC.tar.gz` from [this page](http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html). Check the hash of the downloaded file:

```
$ sha256sum db-4.8.30.NC.tar.gz
12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef

```

Then uncompressed the archive:

```
$ tar -xvf db-4.8.30.NC.tar.gz 

```

Before stepping inside the newly created directory, create a directory `db4` for the sake of installing the Berkeley database:

```
$ BDB_PREFIX="$(pwd)/db4"
$ mkdir $BDB_PREFIX

```

So we can now build the Berkeley database as follows:

```
$ cd db-4.8.30.NC/build_unix
$ ../dist/configure --enable-cxx \
                    --disable-shared \
                    --with-pic \
                    --prefix=$BDB_PREFIX
$ make install

```

Note that `make install` does not require super user rights, since the project is configured with a `--prefix` option which means the binaries
are installed in a file system hierarchy which you own. Once `make install` terminates, you can check that your `db4` directory has been duly set up with `bin` `docs` `include` and `lib` sub-directories.

Having installed the Berkeley database, **you can now focus on building bitcoin core** (and its other dependencies which are easier to install). First install the official bitcoin source repository:

```
$ git clone https://github.com/bitcoin/bitcoin.git

```

Then move to the bitcoin directory:

```
$ cd bitcoin

```

Check the available version tags:

```
$ git tag

```

Synchronize your local code with the version you want:

```
$ git checkout v0.13.2 

```

**From this point on, everything is explained in the file `doc/build-unix.md`** I am repeating things here for emphasis, as it may bring light on a few points, but this post will be out of date soon and you should really refer to `doc/build-unix`.

Add the following line to your file `/etc/apt/sources.list` with the right mirror:

```
deb http://[mirror]/debian oldstable main

```

Then:

```
$ sudo apt-get update

```

Then install the packages described in `doc/build-unix.md` (build requirement). When it comes to boost, hopefully the debian repository version is enough:

```
$ sudo apt-get install libboost-all-dev

```

As indicated in the file, also install these packages:

```
$ sudo apt-get install libminiupnpc-dev

$ sudo apt-get install libzmq3-dev

```

At this stage, you need to install the GUI dependencies as per file.

Once this is done you can start the build. However, you will need to refer to your `db4` directory created while building the Berkeley database version `4.8.30`. The simplest option is to create a link:

```
$ ln -s ~/path-to/db4 db4

```

**Then the build can start:**

```
$ ./autogen.sh
$ ./configure LDFLAGS="-L/path-to/bitcoin/db4/lib/" \
              CPPFLAGS="-I/path-to/bitcoin/db4/include/"
$ make
$ make check 
$ sudo make install

```

Your software should be installed now, and you can check this is the case:

```
$ which bitcoind
$ which bitcoin-qt
$ which bitcoin-cli

```

**Note**: since you already have `v0.12.0` running, you should have a directory `~/.bitcoin` with your config file, debug file, wallet file, blockchain data etc. Your new installed version should pick things up from there (in particular you will not need to sync the blockchain again).

> **Comments:**
> **username_0**: I was kind of afraid the answer might be something like this. My problem with doing downloads (even aside from builds) is that there are core updates 4-5 times every year. I don't really want to be investing hours of my time every year doing one update after another. After all, what is this supposed to be, Microsoft Windows?  
> **username_2**: @Tyler, you are entitled to your own choice. However, if I may share my own experience, I was totally new to Linux not so long ago and I used to feel overwhelmed at the prospect of upgrading. Now I am so glad I invested in understanding the process. I find it so gratifying when it all works. I am now enjoying every new upgrade and it is very quick. My guess is that if you make that investment, you'll be as glad as I am. Note that upgrading is easier: `git pull` , check the new tags, `git checkout <version>` etc... you don't need to re-install dependencies.  

---

