Code::Blocks on Ubuntu

December 6th, 2009 Leave a comment Go to comments

At the time of writing, Ubuntu only has Code::Blocks 8.02 in the repositories, and the nightly binary builds are only supplied for Windows form the Code::Blocks developers. Thankfully, a forum user named Jen supplies packages compatible with Ubuntu so let’s get at it…

First we need to add the sources for the latest wxWidgets builds, you can either do this through the System -> Administration -> Software Sources menu, or directly editing your /etc/apt/sources.list with your favorite text editor. Remember to edit it as root or via sudo. When ready, add these lines (substitute your distribution for dist, i.e. jaunty-wx – NOTE : there are as yet no builds for karmic, but the jaunty ones work just fine):

deb http://apt.wxwidgets.org/ dist-wx main
deb http://apt.jenslody.de/ any main
deb-src http://apt.jenslody.de/ any main

Then you need to add the signature keys for the packages, enter these commands at a prompt:

sudo apt-get update
sudo apt-get install jens-lody-debian-keyring
wget -q http://apt.wxwidgets.org/key.asc -O- | sudo apt-key add -

You may well receive an error when installing the jens-lody-debian-keyring, it’s fine to push through it.

Now we’re ready to pull down the compiler itself and Code::Blocks IDE, simply enter the following the command into a prompt:

sudo apt-get install build-essential codeblocks

You should now have the latest nightly SVN of Code::Blocks, enjoy coding!!

  1. Kate
    December 10th, 2009 at 02:05 | #1

    Super! Thanks for that.

    One question – should the wxWidgets updates be showing up as unauthenticated when I use Update Manager/apt-get update? Or does that only happen the first time?

    • December 10th, 2009 at 09:00 | #2

      Yes, both wxWidgets and the SVN build of Code::Blocks with show as unauthenticated the first time you run apt-get update. This is because for some reason, jens decided to package his security key and load in into his repository, rather than host it as a plain PGP key for importing like most other 3rd party repositories do.
      The keys are imported before the actual packages themselves are downloaded, so by the time you apt-get install build-essential codeblocks all repositories should be authenticated and you should not receive warnings.

  1. December 6th, 2009 at 22:59 | #1