1

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.)

  • How did you install Bitcoin Core 0.12.1? Just repeat the procedure. – Pieter Wuille Feb 9 '17 at 18:26
  • @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. – Tyler Durden Feb 9 '17 at 18:29
  • You can just download the new binary and replace the old one, if you don't want to compile from scratch. – Pieter Wuille Feb 9 '17 at 19:11
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. 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).

  • 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? – Tyler Durden Feb 9 '17 at 17:00
  • 1
    @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 Feb 9 '17 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.