Install Code::Blocks in Ubuntu 12.10
Solution 1
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.
Solution 2
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)
Solution 3
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:
Download the .tar.gz source code for Code::Blocks 12.11 in http://prdownload.berlios.de/codeblocks/codeblocks_12.11-1.tar.gz
Open a terminal, then type
cd ~/Downloads
(or any download location you have presetted)Run
tar -zxf codeblocks_12.11-1.tar.gz
Run
sudo apt-get build-dep codeblocks
Run
cd codeblocks-12.11release8629
Run
./configure
After completion type
make && sudo make install
(orcheckinstall
to get debian packages`.
After step 5 there is another method:
Run
debuild
.Run
cd ..
Run
dpkg -i (the produced codeblocks packages)
and it is installed!
Solution 4
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.
Related videos on Youtube
Bruce
Updated on September 18, 2022Comments
-
Bruce almost 2 years
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 runsudo 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?
-
Lucio about 11 yearsI wont trust in your source..
-
moorkaï about 11 yearsTest it in a VM if you think it's harmful. I'm just trying to be helpful, don't hate me for that!
-
Lucio about 11 yearsThey are already several PPA for this..
-
moorkaï about 11 yearsPardon 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ï about 11 yearsOkay, 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. -
WonderCsabo over 10 yearsSomehow 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