Compiling Bitcoin on Ubuntu 10.04 (Lucid)

In case you don’t know, Bitcoin is a decentralized crypto-currency or as the site says a “peer-to-peer network based digital currency”. While most people have been content to use the pre-compiled binaries available, some of us prefer to compile the client from source, for various reasons. Personally, I maintain a repository on github because I like using a number of patches that various programmers have put forth in the Bitcoin community. Whatever your reason for compiling from source, you have likely run into issues with compiling the graphical client since it requires the development version of wxWidgets. After a whole lot of failed attempts to compile the Bitcoin client I finally found a working configuration.

I have tested this process only on Ubuntu 10.04 (Lucid), both 64 and 32bit. From what I can tell earlier versions of Ubuntu and Debian should work just fine, but with a different set of packages. Specifically the “libboost-all-dev” package appears to only be available in Ubuntu 10.04, but the “libboost-dev” package may work for earlier versions and/or Debian.

First you need to install the proper packages:

sudo apt-get install build-essential libgtk2.0-dev libssl-dev libdb4.7-dev libdb4.7++-dev libboost-all-dev checkinstall subversion git-core

Next, you will need to download the 2.9 version of wxWidgets from their SourceForge project. I suggest creating a folder in your home directory called “src”, where we can compile wxWidgets and Bitcoin. Once the folder has been created we can download the 2.9 version of wxWidgets from their SourceForge project, and extract it. I’ve written out example steps below:

cd ~
mkdir src
cd src
wget ""
tar -zxvf wxWidgets-2.9.0.tar.gz
cd wxWidgets-2.9.0/

Now that wxWidgets is extracted, you are ready to begin compiling it. First, create a build directory and change to it.

mkdir buildgtk
cd buildgtk

Now configure and build wxWidgets:

../configure --with-gtk --enable-debug --disable-shared --enable-monolithic

We could just run “sudo make install”, but that would put a bunch of wxWidget files all throughout your filesystem with no way to easily remove them. Luckily, the checkinstall program allows you to create a Debian package on the fly! This allows you to quickly and easily remove the files installed by wxWidgets. Let’s get started:

sudo checkinstall

You’ll probably be prompted to “create a default set of package docs”, just go ahead and hit enter. When it prompts you for the package description, just put “wxwidgets” without the quotes and hit enter twice. You should have a screen that looks like this:

**** Debian package creation selected ***
This package will be built according to these values:
0 -  Maintainer: [ [email protected] ]
1 -  Summary: [ wxwidgets ]
2 -  Name:    [ build ]
3 -  Version: [  ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ i386 ]
8 -  Source location: [ build ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ build ]
Enter a number to change any of them or press ENTER to continue:

Select “3” for version, then put “2.9” as the version number. Once you are back at the package creation menu, hit enter again to install wxWidgets and build the package. Once it’s done, you will need to run the following command:

sudo ldconfig

Now you are ready to download the Bitcoin source and compile the client! Change back to the “src” directory we created earlier:

cd ~/src

If you want to download the latest version of Bitcoin from the official subversion repository, run the following:

svn co bitcoin-trunk

Optionally you can download the source code for a different version of the Bitcoin client, such as from my git repository (with various community patches I’ve added):

git clone git://

Once the source code has been downloaded you will need to change to the directory of whichever version you picked. Once there you only need to run one command to compile the Bitcoin graphical client:

make -f makefile.unix bitcoin

If you want to compile the bitcoin daemon, the command is:

make -f makefile.unix bitcoind

If everything went well there will be a file called “bitcoin” in the current directory. I suggest copying the file to “/usr/local/bin” and making sure it’s owned as root with the permissions 755 so that no one but root can modify it.

If this article helped you out, please send some Bitcoins to the Bitcoin Faucet and help spread the word about Bitcoin.

20 comments for “Compiling Bitcoin on Ubuntu 10.04 (Lucid)

  1. memento
    October 3, 2010 at 1:12 pm

    Hello !

    I precisely followed your tutorial and finnally got this error wile launching bitcoin bin :

    “An assertion failed !

    ../src/gtk/settings.cpp(276): assert “font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName())” failed in GetFont().”

    I’ve got quite the same from the console :
    “19:51:51: Debug: ../src/gtk/settings.cpp(276): assert “font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName())” failed in GetFont().”

    Apparently, this comes from the “wxWidgets-2.9.0/src/gtk” source.

    Ok, I know debugging is not what you intended to do while writting this tuto, but I’m quite stuck right now.

    I must say too that I got the same mistake with the official compiling&executing from the official source.

    Greetings from France.
    Hope you could help me.
    I really believe in this project !

  2. October 12, 2010 at 12:50 pm

    Thanks bro, works like a charm

  3. h
    May 21, 2011 at 6:32 am

    [email protected]:~/src/bitcoin-trunk$ make -f makefile.unix bitcoin
    make: wx-config: Command not found
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -DGUI -o obj/util.o util.cpp
    In file included from util.cpp:5:0:
    headers.h:30:19: fatal error: wx/wx.h: No such file or directory
    compilation terminated.
    make: *** [obj/util.o] Error 1

  4. May 22, 2011 at 1:20 am

    This guide is probably outdated now but your error seems to indicate that wxwidgets either isn’t installed or isn’t in your path.

  5. watchpocket
    May 22, 2011 at 9:55 pm

    FYI: Ubuntu 10.04 is Lucid Lynx.
    Ubuntu 9.10 is Karmic Koala.

    I’m still running the real Karmic — v. 9.10. Will this tutorial work for Ubuntu version 9.10? For 64-bit 9.10?

  6. May 22, 2011 at 11:19 pm

    Good catch, I’ve fixed the post to say Lucid. I haven’t tried it, but it should work on 9.10 as well.

  7. watchpocket
    May 23, 2011 at 12:41 am

    Everything was going beautifully until the end, when did not have a file “bitcoin” in the ~/src/bitcoin-patchwork directory, and when I got this:

    /usr/bin/ld: cannot find -lboost_system
    collect2: ld returned 1 exit status
    make: *** [bitcoin] Error 1
    make -f makefile.unix bitcoin 84.83s user 4.22s system 98% cpu 1:30.26 total

    I’m running Ubuntu 9.10, 64-bit. I installed libboost-dev. After seeing the error message above, I tried to install libboost-all-dev, and got this:

    “E: Couldn’t find package libboost-all-dev”

    I then tried to install libboost-dev again, got this:

    “libboost-dev is already the newest version.”

    So: my problem appears to be that

    “/usr/bin/ld: cannot find -lboost_system”

    and I frankly have no clue what to do about that.

    I did see this post on the Bitcoin forum, but I don’t really know what it means for me, or what I might do about it.

    “Title: Re: 0.3 almost ready
    Post by: satoshi on June 24, 2010, 05:40:05 pm
    Here’s RC1 for linux for testing:
    (link removed, see below)

    It contains both 32-bit and 64-bit binaries.

    Recent changes:

    – Added instructions for building wxBase, which is needed to compile bitcoind.
    – The package libboost-dev doesn’t install anything anymore, you need to get libboost-all-dev.
    – Updated version numbers.

    – The libboost libraries have removed the “-mt” from their filenames in 1.40. If you’re compiling with Boost 1.38 or lower, like on Ubuntu Karmic, you would need to change it back to boost_system-mt and boost_filesystem-mt.”

    But exactly where & how would I add the “-mt”?

    I did see this at the end of a huge bunch of stuff thrown onto my screen:

    “. . . -Bstatic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx -l crypto -Wl,-Bdynamic -l gthread-2.0
    /usr/bin/ld: cannot find -lboost_system
    collect2: ld returned 1 exit status
    make: *** [bitcoin] Error 1”

    [The latter part being a repeat of what I quoted above.]

    I get the feeling I’m an inch away from successful installation, & hoping some clues are provided for anyone who can parse them & make a suggestion.


  8. watchpocket
    May 23, 2011 at 12:45 am

    Thanks, by the way, for this detailed tutorial as it is. I never expected it to even go as well as it did for me. Now if I can only somehow resolve the libboost catch-22. . . .

    Thanks again, great help to have this. I tried last week w the PPA & got nowhere within a few seconds.

  9. watchpocket
    May 23, 2011 at 12:58 am

    Btw I did not get to the command:

    “make -f makefile.unix bitcoind”

    The error message I got came at the end of running
    “make -f makefile.unix bitcoin”

    Looking now to see if I already have the Boost program anywhere in the src dir or wxWidgets-2.9.0 subdir or the bitcoin-patchwork subdir, and if I do, what version it might be.

    Or does the error message mean the Boost program itself was not installed? There’s got to be a way. . . .

  10. watchpocket
    May 23, 2011 at 1:32 am

    I definitely have Boost v. 1.38. I just don’t know how to “change it back to boost_system-mt and boost_filesystem-mt.”

  11. watchpocket
    May 23, 2011 at 2:43 am

    Btw you should also change “karmic” to “lucid” in your URL.

  12. watchpocket
    May 24, 2011 at 1:04 am

    Got it up & running, thanks. I just went into makefile.unix and added the “-mt” onto the four boost libs.

  13. eriz
    August 1, 2011 at 1:12 pm


    I’ve followed the guide, but it seems like it’s not up to date anymore with trunk.

    After installing everything, I get this:
    [email protected]:~/Development/bitcoin/src$ make -f makefile.unix
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXDEBUG__ -D__WXGTK__ -pthread -DGUI -o obj/util.o util.cpp
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXDEBUG__ -D__WXGTK__ -pthread -DGUI -o obj/script.o script.cpp
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXDEBUG__ -D__WXGTK__ -pthread -DGUI -o obj/db.o db.cpp
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -D__WXDEBUG__ -D__WXGTK__ -pthread -DGUI -o obj/net.o net.cpp
    net.cpp:22:32: error: miniupnpc/miniwget.h: No such file or directory
    net.cpp:23:33: error: miniupnpc/miniupnpc.h: No such file or directory
    net.cpp:24:36: error: miniupnpc/upnpcommands.h: No such file or directory
    net.cpp:25:34: error: miniupnpc/upnperrors.h: No such file or directory
    net.cpp: In function ‘void ThreadMapPort2(void*)’:
    net.cpp:1084: error: ‘upnpDiscover’ was not declared in this scope
    net.cpp:1086: error: aggregate ‘UPNPUrls urls’ has incomplete type and cannot be defined
    net.cpp:1087: error: aggregate ‘IGDdatas data’ has incomplete type and cannot be defined
    net.cpp:1090: error: ‘UPNP_GetValidIGD’ was not declared in this scope
    net.cpp:1098: error: ‘UPNP_AddPortMapping’ was not declared in this scope
    net.cpp:1103: error: ‘UPNPCOMMAND_SUCCESS’ was not declared in this scope
    net.cpp:1105: error: ‘strupnperror’ was not declared in this scope
    net.cpp:1111: error: ‘UPNP_DeletePortMapping’ was not declared in this scope
    net.cpp:1113: error: ‘freeUPNPDevlist’ was not declared in this scope
    net.cpp:1114: error: ‘FreeUPNPUrls’ was not declared in this scope
    net.cpp:1121: error: ‘freeUPNPDevlist’ was not declared in this scope
    net.cpp:1123: error: ‘FreeUPNPUrls’ was not declared in this scope
    make: *** [obj/net.o] Error 1

  14. Jader
    September 3, 2011 at 1:19 pm

    In Natty, when I sudo checkinstall, after changing the version and hitting enter it doesn’t build the package because of

    /usr/bin/install -c -d /usr/local/lib/wx/config
    /usr/bin/install: cannot create directory `/usr/local/lib/wx’: No such file or directory
    make: *** [install-wxconfig] Error 1

    **** Installation failed. Aborting package creation.

    Cleaning up…OK


  15. April 11, 2015 at 3:19 am

    Thanks for one’s marvelous posting! I really enjoyed reading it, you could
    be a great author.I will always bookmark your blog and will come
    back in the foreseeable future. I want to encourage that you continue
    your great work, have a nice holiday weekend!

  16. July 22, 2015 at 5:09 am

    If there’s an extremely low level of risk involved, fees can be as low as 1 percent of the
    invoice amount. In these times, small businesses must focus
    on the customer, costs and cash flow. In order for a business to be eligible for invoice factoring, the factor has to determine
    the creditworthiness of the clients of that business since they are ultimately going to
    be responsible for payment of the invoices.

  17. November 28, 2015 at 1:30 pm

    While planning a trip to another country, a large number of visitors ignore
    or forget to book their airport transfers accommodation before departure.
    Alicante Airport sits 10 miles outside of the city center connected to fantastic modern roads linking
    the neighboring regions and towns, its approximately 90 kilometers away
    from La Manga del Mar Menor, roughly 50 minutes drive and there are excellent airport transfer companies offering quick simple transport to you holiday destinations.
    The pricing policies of By Transfer company is so simple and convenient for their clients.

  18. December 3, 2015 at 12:47 am

    Preschoolers love silly songs and will never suspect the following sing-song
    poems are also educational. Keep in mind that the baby’s hands are still very soft and therefore should be treated gently.
    It can be expensive trying to have another big holiday meal
    when you had one just a month ago in November.

  19. December 19, 2015 at 8:19 pm

    Any person on earth with web-based access can be linked to the site.
    Many people wonder why it doesn’t just make sense
    to maintain a dedicated mobile site instead of redesigning the site with a
    responsive web design. cards, or improved
    yet, full-color postcards to newsletter with.

  20. December 31, 2015 at 1:38 pm

    Once you arrive your money is now sitting at
    another curb for a few more hours while you are inside enjoying with family and friends.
    Perhaps you want to impress an out-of-town business partner or
    plan a birthday for your best friend. The ‘Best of Orange County’ is in a sense, a walking
    or, rather, delivered billboard.

Comments are closed.