Code::Blocks is free and open-source software highly extensible Integrated Development Environment (IDE) for the C, C++, and Fortran programming languages. It features support for a wide range of compilers, parallel builds, and multi-target projects and also provides an interface with GNU GDB. The code editor in Code::Blocks features syntax highlighting, code folding, a tabbed interface, code completion, a class browser, and smart indenting.
In the following tutorial, you will learn how to install Code::Blocks on Fedora 37/36/35 Linux desktop with either DNF or Flatpak package manager using the command line terminal and instructions on updating and removing the software in the future if required.
Table of Contents
Recommended Steps Before Installation
Before you continue, your system is advised to ensure all existing packages are up to date to avoid system conflicts.
sudo dnf upgrade --refresh -y
#1st Method – Install Code::Blocks – DNF Method
The first and easiest method to install Code::Blocks is to use the DNF package manager, which can be done using the following command.
sudo dnf install codeblocks -y
#2nd Method – Install Code::Blocks – Flatpak Method
The second option is to use the Flatpak package manager. Flatpak is installed natively on Fedora, should the installation should be straightforward.
First, re-install the Flatpak manager if it was removed previously.
sudo dnf install flatpak -y
For users installing Flatpak for the first time, it is often recommended to reboot your system. Failure to do this can occur with odd issues, such as wrong icon paths.
SKIP THE REBOOT IF FLATPAK IS INSTALLED.
Next, you need to enable Flatpack using the following command in your terminal.
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Next, you can install the Code::Blocks Flatpak with the following command.
flatpak install flathub org.codeblocks.codeblocks
If the above command does not work and you receive the “error: Unable to load summary from remote flathub: Can’t fetch summary from disabled remote ‘flathub,” use the following command.
sudo flatpak remote-modify --enable flathub
Once installed, you can proceed to launch.
Now, the best method to launch Code::Blocks is using the application icon.
Activities > Show Applications > Code::Blocks
Alternatively, you may want to use it for applications quite frequently. Right-click the icon and add it to favorites, making the icons appear on the taskbar.
The first time you open the IDE, you will notice a prompt asking you about the compiler choice. Set the default, which you can change later by installing additional compilers.
Once open, you will land at the default application start screen. For first-time users, I would strongly recommend visiting the Code::Blocks user manual.
Next are the commands to run in your terminal to check for updates. These commands will blanket-check all installed packages on your system that match the installation package manager. Ideally, you should run this regardless, even if auto-updates are set up to ensure your system is up-to-date, and no update errors occur for newer users.
Update DNF Method
sudo dnf update --refresh
Update Flatpak Method
Remove DNF Method
For users that installed the DNF version, remove the application as follows.
sudo dnf autoremove codeblocks
Remove Flatpak Method
To remove the Flatpack version, run the following command.
flatpak uninstall --delete-data org.codeblocks.codeblocks
Another handy hint can be to use the following command to ensure Flatpak has not left behind any unnecessary packages as it is known to sometimes.
flatpak remove --unused