4

I installed Code::Blocks from Muon Software Center (I'm using KDE) and I got Code::Blocks 10.05.

I found this link: https://launchpad.net/~pasgui/+archive/ppa/

After adding this PPA, and running sudo apt-get update if I run sudo apt-get install codeblocks, which version of Code::Blocks will I get? If I download the tarball from the main site, how to I install it properly?

Can someone help me out?

7 Answers 7

4

Install Codeblocks 12.11 on Ubuntu 12.04 / 12.10

1º) Install libraries wxWidgets

$ sudo apt-get install libwxgtk2.8-0
$ sudo apt-get install libwxgtk2.8-dev

2º) Download libraries http://packages.debian.org/squeeze/libhunspell-1.2-0 (pay attention if your distribution is 32 or 64 bits) and install (This prevents errors when installing codeblocks)

$ sudo dpkg -i libhunspell-1.2-0_1.2.11-1_amd64.deb

3º) Download the binaries http://www.codeblocks.org/downloads/26 (pay attention if your distribution is 32 or 64 bits) Debian stable is: codeblocks_12.11-2_amd64-debian-stable.tar.bz2 (squeeze) Unzip to a folder and install:

    $ sudo dpkg -i *.deb

4º) If you develop for MySql Install MySql connector Download the version for your distribution from the official site mysql-connector-c-shared_6.1.0-2_amd64.deb and install

$ sudo dpkg -i mysql-connector-c-shared_6.1.0-2_amd64.deb

5º) Finally the library with header files for MySql

$ sudo apt-get install libmysqlclient-dev

(To install the MySQL server search on google)

1
  • Somehow the dependencies of codeblocks-contrib package was not installed, and Code::Blocks complained about it. I ran sudo apt-get -f install, that corrected the problem Nov 30, 2013 at 10:31
2

It will most likely install the newer version off the PPA. An easy way to check is to do apt-get install -s codeblocks and see what happens during the simulated install.

Tarballs are a little tricky. I recommend installing build-essential and checkinstall in addition to any dependancies that codeblock needs. Download the tarball, and expand it in a working directory with tar -xf filename.tar.gz. Then read the install file if any for instructions

Typically you need to pull in dependancies - an easy way to do this is to use apt-get build-dep. Then you run ./config (which checks if prerequisites are met and sets system specific stuff), make (which compiles), and make install(which moves the compiled files to the right places). I replace make install with checkinstall to make a deb and install that instead cause its easier to uninstall. YMMV - some applications replace make with cmake and so on.

2

Since you are using Ubuntu 12.10, I'm sorry to inform you that you will still be getting the Code::Blocks 10.05 version even after adding the PPA, since according to https://launchpad.net/~pasgui/+archive/ppa/+packages the codeblocks package for 12.11 is for Precise and not for Quantal.

And also, since the Code::Blocks version in the Ubuntu software repositories (quantal-release universe) https://launchpad.net/ubuntu/+source/codeblocks is also 10.05, it might seem to be that you can't install Code::Blocks 12.11 using either the Ubuntu repositories or PPAs.

For the remaining installation method refer to @JourneymanGeek's answer.

Detailed guide:

  1. Download the .tar.gz source code for Code::Blocks 12.11 in http://prdownload.berlios.de/codeblocks/codeblocks_12.11-1.tar.gz

  2. Open a terminal, then type cd ~/Downloads (or any download location you have presetted)

  3. Run tar -zxf codeblocks_12.11-1.tar.gz

  4. Run sudo apt-get build-dep codeblocks

  5. Run cd codeblocks-12.11release8629

  6. Run ./configure

  7. After completion type make && sudo make install (or checkinstall to get debian packages`.

After step 5 there is another method:

  1. Run debuild.

  2. Run cd ..

  3. Run dpkg -i (the produced codeblocks packages) and it is installed!

1

After several trials and errors, I have successfully installed Codeblocks 12.11 on my laptop running Ubuntu 12.04. Luckily, I've documented the steps required to complete the installation process. This involved downloading the binary and getting all necessary dependencies.

Just open up terminal (Ctrl + Alt + T) and type this:

cd ~
mkdir codeblocks
wget -t 0 -P /home/<username>/codeblocks http://downloads.sourceforge.net/project/codeblocks.berlios/codeblocks_12.11-2_i386-debian-stable.tar.bz2
cd codeblocks
tar xvjf *
sudo apt-get update
sudo apt-get -y install gcc build-essential gamin libgamin0 libwxbase2.8-0 libwxgtk2.8-0
sudo dpkg -i libcodeblocks0_12.11-2_i386.deb codeblocks-common_12.11-2_all.deb codeblocks_12.11-2_i386.deb

You need to change the <username> on step 3 with your username.

I'm not sure whether one or more steps are wrong nor unnecessary. It just works somehow.

Hope this helps.

0

First off, it's always recommended to use the version that is in the normal repositories of Ubuntu, which can be installed via the software centre (currently v. 10.05).

The PPA mentioned does not contain a version for Ubuntu 12.10, so in that case you'd have to manually add the "precise" (Ubuntu 12.04) section of that repository, which seems to have v. 12.11 of C::B.

Installing from the homepage will probably be complex, do it only if you have to (see Journeyman Geek's answer).

0

Just

sudo apt-add-repository ppa:pasgui/ppa; sudo apt-get update;
sudo apt-get -y install codeblocks`

, it does the job.

If you want to download the tarball then after downloading extract the archive contents and navigate to the extracted folder .. execute the binary file with ./ before the executed file name "something like ./codeblocks".

To add it to your unity "not required if you install it via ppa" :

  1. Move the extracted folder to /opt using sudo mv <folder_name> /opt
  2. Adding to menus can be through alacarte .. install it using sudo apt-get install alacarte , after installing launch alacarte from unity "It's named Main Menu" and add the item "or application" where you like it to be "usually in programming tools menu" and specify the execution command as the path of executing file that's in the folder we've moved to /opt.
-2

You can also install Code::Blocks from my PPA if you don't fancy compiling from source.

5
  • 1
    I wont trust in your source..
    – Lucio
    Apr 27, 2013 at 20:10
  • Test it in a VM if you think it's harmful. I'm just trying to be helpful, don't hate me for that!
    – moorkaï
    Apr 29, 2013 at 11:10
  • 1
    They are already several PPA for this..
    – Lucio
    Apr 29, 2013 at 19:23
  • 1
    Pardon my ignorance, but could you point me to these PPAs? I know for pasgui's PPA, but it has Code::Blocks built only for Precise Pangolin. Yeah, you can install the "precise" version, but mixing versions seems like a bad (not necessarily harmful) idea, CMIIW. On the other side, pasgui built only douml for quantal, so I don't consider Code::Blocks available from his PPA in a conventional way.
    – moorkaï
    May 9, 2013 at 19:52
  • 1
    Okay, Lucio was right, there really was an other PPA by a fella called Vincent Cheng which had a build of Code::Blocks for Quantal seven weeks earlier than me (this one). If you want to install Code::Blocks from there instead, add ppa:vincent-c/ppa to your sources list. I somehow succeeded not to find it (I guess Google didn't index his PPA in a timely fashion, because there's no other reason I would omit it), so it's up to you guys which PPA are you going to use. Unless if there's some functional difference I failed to notice.
    – moorkaï
    Jun 2, 2013 at 11:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .