24

I am using 64-bit Ubuntu and I want to install the Code::Blocks IDE. Is there any repository?

edwinksl
  • 24,109
Namshum
  • 1,825
  • 4
  • 25
  • 32

9 Answers9

24

It's available in the Software Center.

Just open the Ubuntu Software Center and search for its name.

Or install via the terminal:

sudo apt-get install codeblocks
Kulfy
  • 18,154
19

Note: damien-moore's PPA mentioned in this answer has Code::Blocks version 16.01 and does not support releases after 16.04.

From the Code::Blocks website, the download page for Linux points to the Code::Blocks Release Builds PPA, which is probably the easiest way to install a reasonably up-to-date version of Code::Blocks. To install Code::Blocks from the aforementioned PPA, do the following:

sudo add-apt-repository ppa:damien-moore/codeblocks-stable
sudo apt-get update
sudo apt-get install codeblocks codeblocks-contrib
Kulfy
  • 18,154
edwinksl
  • 24,109
11

Code::Blocks is a cross-platform Integrated Development Environment (IDE). It is based on a self-developed plugin framework allowing unlimited extensibility. Most of its functionality is already provided by plugins. Plugins included in the base package are:

  • Compiler frontend to many free compilers
  • Debugger frontend for GDB (and CDB for windows platforms)
  • Source formatter (based on AStyle)
  • Wizard to create new C++ classes
  • Code-completion / symbols-browser (work in progress)
  • Default MIME handler
  • Wizard to create new Code::Blocks plugins
  • To-do list
  • Extensible wizard based on scripts
  • Autosave (saves your work in the unfortunate case of a crash)1

To download and install click the image below.

Install via the software center

1Source:Ubuntu Apps Directory

Kulfy
  • 18,154
Mitch
  • 109,787
5

You can install CodeBlocks using following command:

sudo apt-get install codeblocks
2

All you need to do is to run:

sudo apt-get update

then

sudo apt-get upgrade

and then

sudo apt-get install codeblocks

Your repository list isn't up to date, you got update suggestion from Ubuntu. If you want to be Linux programmer I'm recommending you getting LPIC-1 knowledge before you start. It is crucial to understand basics of this system to code for it.

edwinksl
  • 24,109
nethero
  • 131
1

If you plan to develop on ubuntu its beneficial to learn how to compile code from the command line ... even the codeblocks IDE

download source code

http://www.codeblocks.org/downloads

pick file similar to codeblocks_16.01.tar.gz

cd into where you wish to expand the tarball and issue

tar xvf /path/to/codeblocks_16.01.tar.gz

cd codeblocks-16.01.release

autoreconf -fi  #  
./configure  #  standard check to confirm your have necessary libs
make -j4   # actual compile and link step
sudo make install  # install binary and its libs
sudo ldconfig  # this registers your new libs

now its installed ... go ahead and launch

codeblocks   #  Voila you have launched your new IDE

If above gives errors you probably have yet to install upstream dependancies ... if so this may help

sudo apt-get install build-essential 
sudo apt-get install -y libwxbase3.0-0v5 libwxbase3.0-dev libwxgtk3.0-dev wx3.0-headers wx-common
sudo apt-get build-dep codeblocks 
0

I have quite a few methods do whatever you like

1. Download binaries

Current Version is 20.03 if you are reading this in future, go to this URL and check for the latest version http://www.codeblocks.org/downloads/binaries

Download the zip and install it on your system, there are .deb files.

2. Add PPA

You can add the official PPA from the launchpad, and can get updates as soon they release

Notice here - Ubuntu 20.04 is still not supported so don't get frustrated if its not installing in 20.04

sudo add-apt-repository ppa:codeblocks-devs/release\
&& sudo apt-get update \
&& sudo apt-get install codeblocks codeblocks-contrib

if you have 18.04 then do this ->

deb http://ppa.launchpad.net/codeblocks-devs/release/ubuntu bionic main\
&& deb-src http://ppa.launchpad.net/codeblocks-devs/release/ubuntu bionic main 

3. Use apt

sudo apt install code-blocks

I'm not 100% sure but i think these packages are maintained by canonical itself, so updates will be very slow, but there are only one or two updates in code block every year so you wont miss a lot of things even if you use this one.

Good luck doing C++, Its not python.

0

I suggest to use newest version from 'Jens' Even if it's unofficial, we can get all versions. You can also choose repositury or just'deb' file.

http://apt.jenslody.de/

For stable release, add these two lines to the sources.list file and refresh the package index

deb [arch=amd64,i386] https://apt.jenslody.de/stable jessie main
deb-src https://apt.jenslody.de/stable jessie main

Then install the codeblocks. Tested on Ubuntu 12.04 - both 32 and 64 bit.

Anwar
  • 77,855
0

You can try installing the packages manually. Connecting via FTP to the archives with your file manager. Or download manually from the site in the link below.

Alternatively install it via GUI with GDEBI by clicking each deb file which will indicate if another package/dependency is missing then install that one first. You can start with Codeblocks and GDEBI will indicate the directly related packages and you follow that and avoid getting lost in dependencies.

Don't know if a file association can be made to click and trigger GDEBI directly from the browser.

FTP : Archives

The server is : ftp.archive.ubuntu.com

And the path to Codeblocks is : ubuntu/ubuntu/pool/universe/c/codeblocks

In a terminal type : ftp

Then comes the propmt

ftp> open ftp.archive.ubuntu.com
user
anonymous
>Type password
"leave blank"
cd ubuntu/ubuntu/pool/universe/c/codeblocks
get *.deb

The files will be saved to HOME

delete the DEBs of the undesired architecture

Save this script :

#!/bin/bash
# Reference
# http://www.cyberciti.biz/faq/bash-for-loop/
# https://www.dbsysnet.com/2015/12/using-bash-arrays-with-examples
BLOCKS=( hello young flying sun you don look old at all);
for LIST in 0 1 2 3 4 5 6 7 8 9 10 11 12
do
    echo ${BLOCKS[LIST]};
done;

You can check for answers on how to use the script, Make it executable and run it from the HOME.

Replace echo with the bash command to install packages :

dpkg -i ${BLOCKS[LIST]};

Change the list message with the list of packages for Codeblocks in the HOME folder

ls *.deb

Match the number of packages to the list of 12 elements

If 20 elements then 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

userDepth
  • 2,040