How to Install Code::Blocks on Ubuntu 22.04 or 20.04

Code::Blocks is a robust, open-source Integrated Development Environment (IDE) tailored for developers working with C, C++, and Fortran programming languages. For individuals looking to install Code::Blocks on Ubuntu 22.04 Jammy Jellyfish or its older stable release of Ubuntu 20.04 Focal Fossa, this introduction outlines its key features and value to the programming community.

Key Features of Code::Blocks:

  • Extensive Language Support: Primarily supporting C, C++, and Fortran, Code::Blocks caters to developers with varied programming language preferences.
  • Compiler Diversity: With support for a broad spectrum of compilers, it ensures compatibility and flexibility during the development process.
  • Parallel Builds & Multi-Target Projects: Code::Blocks facilitates efficient project execution with features like parallel builds and support for multi-target projects.
  • Intuitive Interface: The IDE boasts an interface integrated with GNU GDB, providing a user-friendly environment for developers.
  • Advanced Code Editor: Its code editor enhances the coding experience with syntax highlighting, code folding, tabbed interface, code completion, a class browser, and smart indenting.
  • Global Usage: Being a preferred choice for many organizations worldwide, Code::Blocks has established itself as a reliable tool for C++ development.

With these features, Code::Blocks not only simplifies the development process but also provides a platform that is easy to extend and customize according to the developer’s needs. The upcoming sections will guide you through the straightforward steps to install Code::Blocks on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa, providing a powerful tool for your programming endeavors.

Install Code::Blocks on Ubuntu 22.04 or 20.04 via APT

Step 1: Update Ubuntu Before Code::Blocks Installation

Before proceeding with the tutorial, ensuring your system is up-to-date with all existing packages is good.

sudo apt update

Proceed to upgrade any outdated packages using the following command.

sudo apt upgrade

Step 2: Install Code::Blocks on Ubuntu 22.04 or 20.04 via APT Command

To easily install Code::Blocks on Ubuntu using the APT package manager, execute the following command:

sudo apt install codeblocks

Install Code::Blocks Plugins on Ubuntu

Optionally, you can install the “codeblocks-contrib” package. This will allow you to install plugins and other features to enhance your IDE.

sudo apt install codeblocks-contrib

Install Code::Blocks on Ubuntu 22.04 or 20.04 via Flatpak with Flathub

The second option is to use the Flatpak package manager, which is available from the default Ubuntu repository but not installed, given it’s a competitor to Snaps and the Snapcraft store.

Next, you must enable Flatpack using the following command in your terminal.

sudo flatpak remote-add --if-not-exists flathub

Step 2: Install Code::Blocks on Ubuntu 22.04 or 20.04 via Flatpak Command

Next, you can install the Code::Blocks Flatpak with the following command.

flatpak install flathub org.codeblocks.codeblocks -y

Launch Code::Blocks on Ubuntu 22.04 or 20.04

You can launch Code::Blocks after installing the software on Ubuntu directly from your terminal.

For APT installations, use the following command:


Alternatively, installations of Code::Blocks with Flatpak need to run the following command:

flatpak run org.codeblocks.codeblocks

Users who prefer using the application icon can find it along the following path:

Activities > Show Applications > Code::Blocks
Code::Blocks application icon displayed on Ubuntu 22.04 or 20.04 desktop.
Click on the Code::Blocks icon to launch the application on Ubuntu 22.04 or 20.04.

Upon launching Code::Blocks for the first time, an auto-detect window will appear, notifying you of the compilers detected on your Ubuntu system.

First-time prompt screenshot informing about compilers within Code::Blocks on Ubuntu 22.04 or 20.04.
Screenshot of the first-time compiler prompt you’ll see when launching Code::Blocks on Ubuntu 22.04 or 20.04.

Getting Started with Code::Blocks on Ubuntu 22.04 or 20.04

After successfully installing Code::Blocks on Ubuntu, follow these essential tips to get started:

General Code::Blocks Tips on Ubuntu

  • Explore the Workspace:
    • Familiarize yourself with the Code::Blocks interface. Understanding the layout and where different features are located will expedite your coding process.
  • Read Documentation:
    • Code::Blocks has extensive documentation. Taking time to read through the basics can provide valuable insights and assist you in navigating through the software more efficiently.

Code::Blocks Customization Tips on Ubuntu

  • Adjust Theme and Syntax Highlighting:
    • Under Settings > Editor > Syntax Highlighting, you can customize the appearance of your code, making it more readable and accessible for you.
    • Select a theme that is comfortable for your eyes and enhances code readability. Code::Blocks offers various themes, so explore and choose one that best suits your preferences.
  • Configure Shortcuts:
    • Code::Blocks allows you to set up keyboard shortcuts for almost every action. Navigate to Settings > Editor > Keyboard Shortcuts to personalize them according to your coding habits.

Other Helpful Tips For Code::Blocks on Ubuntu

  • Compile Options:
    • Before running your code, ensure to set up the compiler options correctly. Navigate to Settings > Compiler > Compiler Settings to adjust them according to your project’s requirements.
  • Use Code Blocks Wisely:
    • Use Code::Blocks’ features, like code folding and snippets, to write and navigate your code efficiently. These features can be significant time-savers once you learn how to use them properly.
  • Plugin Management:
    • Code::Blocks supports various plugins to extend its functionality. Explore and install the ones that will benefit your coding experience. To manage plugins, navigate to Plugins > Manage Plugins.

Remember, the more comfortable you become with the Code::Blocks environment, the more efficiently you can work on your Ubuntu system. Happy coding!

Code::Blocks default user interface screenshot on Ubuntu 22.04 or 20.04.
This is how Code::Blocks looks when launched on Ubuntu 22.04 or 20.04 systems.

Additional Code::Blocks Commands on Ubuntu 22.04 or 20.04

Update Code::Blocks on Ubuntu 22.04 or 20.04

Run the following commands in your terminal to check for updates. These commands swiftly check all packages installed on your system that correspond with the installation package manager. Run these commands, even if you have auto-updates enabled, to guarantee an up-to-date system and prevent update errors for new users.

APT Update Command Method on Ubuntu

sudo apt update && sudo apt upgrade

Flatpak Update Command Method on Ubuntu

flatpak update

Remove Code::Blocks on Ubuntu 22.04 or 20.04

APT Remove Method Command on Ubuntu

For users that installed the APT version, remove the application as follows.

sudo apt autoremove codeblocks

Flatpak Remove Method Command on Ubuntu

To remove the Flatpack version, run the following command.

flatpak uninstall --delete-data org.codeblocks.codeblocks


In conclusion, successfully installing Code::Blocks on Ubuntu 22.04 or 20.04 is a straightforward process using either apt commands or the Flatpak method with Flathub. We walked through each step, from initiating installation to launching the software for the first time. Helpful tips for first-time users were provided to ensure a smooth experience. Additionally, we covered essential command line instructions to help you easily update or remove Code::Blocks as needed. With this guidance, you can utilize Code::Blocks efficiently on your Ubuntu system.

Leave a Comment