How to Install Code::Blocks on Fedora Linux

Code::Blocks is an open-source Integrated Development Environment (IDE) for C, C++, and optionally Fortran. Specifically, it supports console tools, wxWidgets GUI projects, classroom examples, and light embedded work. This guide shows how to install Code::Blocks on Fedora Linux from the Fedora repository or Flatpak, verify compiler integration, and optionally add development headers and debugging tools. By the end you will have a working IDE backed by GCC (and other compilers if you choose).

You can install Code::Blocks either from Fedora’s native repositories (stable, integrated) or alternatively via Flatpak from Flathub (sandboxed, often newer). Generally, most users should begin with the Fedora repository method unless they need a more recent upstream release or prefer application isolation.

Choose Your Code::Blocks Installation Method

First, pick the channel that fits your update expectations; importantly, projects remain in your home directory so switching later is safe.

MethodChannelStabilityBest For
Fedora repositoryOfficial distro packagesDistro-testedMost users wanting seamless updates
Flatpak (Flathub)Sandboxed runtimeFrequent updatesUsers needing newer releases or isolation

Recommendation: Use the Fedora repository build first. However, choose Flatpak if you require newer features sooner or prefer sandboxing.

Prerequisites

Code::Blocks requires external compilers to build projects—it does not bundle GCC. Minimal Fedora spins may omit development tools, so install the core toolchain first. Optional libraries (wxWidgets, ccache) are only needed if you plan to compile GUI projects or want faster builds.

Before proceeding, refresh packages and ensure essential compilers are available:

sudo dnf upgrade --refresh

Next, install core toolchain components (add Fortran and debugger support if needed):

sudo dnf install gcc gcc-c++ gdb gcc-gfortran -y

Additionally, optional libraries for wxWidgets GUI development and faster builds are available (only if you plan to compile GUI projects or want extra tooling):

sudo dnf install wxBase wxGTK3 wxGTK3-devel ccache clang -y

Alternatively, install the broad developer collection (large download, optional):

sudo dnf group install "Development Tools" -y

Finally, verify GCC is present and consider installing CMake on Fedora if you plan to work with CMake-based projects (version numbers vary):

gcc --version
gcc (GCC) 14.2.x (Red Hat 14.2.x-x)
Copyright (C) 2024 Free Software Foundation, Inc.

Install Code::Blocks on Fedora via DNF Repository

The Fedora repository method installs Code::Blocks as a native system package. Consequently, this approach ensures automatic updates through regular system maintenance. If you already ran the refresh command above, you can skip repeating it here.

sudo dnf install codeblocks codeblocks-contrib -y

Optionally, inspect package metadata (plugin list, description) before or after installation:

dnf info codeblocks codeblocks-contrib

Afterwards, verify the installation by checking the Code::Blocks version:

codeblocks --version

You should see output similar to the following:

Code::Blocks 20.03

Furthermore, if you need to extend the IDE itself, install development headers (skip unless writing plugins):

sudo dnf install codeblocks-devel codeblocks-contrib-devel -y

Install (or Confirm) Compiler Support

If you skipped the prerequisites earlier, install C and C++ compilers now; otherwise, this section serves as a verification step:

sudo dnf install gcc gcc-c++ -y

Then, verify the compiler installation:

gcc --version

Once executed, the output confirms GCC installed successfully and displays the version number. Currently, Fedora ships GCC 14.x or newer:

gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)
Copyright (C) 2024 Free Software Foundation, Inc.

Verify Code::Blocks Binary Path and Installed Files

Optionally, confirm the binary path and sample files for additional assurance:

which codeblocks
rpm -ql codeblocks | head -n 10

Method 2: Install Code::Blocks via Flatpak

As an alternative to the DNF method, Flatpak installations run in an isolated container, separating Code::Blocks from system libraries. Generally, this approach provides newer releases than distribution repositories, though updates arrive independently from system packages. Moreover, the Flatpak version often tracks upstream releases more closely.

Enable Flathub Repository

First, add the Flathub repository if it is not already configured:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install Code::Blocks via Flatpak

Next, install Code::Blocks from Flathub:

flatpak install flathub org.codeblocks.codeblocks -y

Afterwards, verify the Flatpak installation (shows one line):

flatpak list | grep -i codeblocks
Code::Blocks    org.codeblocks.codeblocks

Additionally, show detailed Flatpak metadata (version, runtime, permissions):

flatpak info org.codeblocks.codeblocks
ID: org.codeblocks.codeblocks
Ref: app/org.codeblocks.codeblocks/x86_64/stable
Arch: x86_64
Branch: stable
Origin: flathub
Version: 20.03 (example)
Commit: <hash>
Runtime: org.freedesktop.Platform <version>

Troubleshoot Flathub Connection Issues

If you encounter “Unable to load summary from remote flathub,” the repository may be disabled. In that case, re-enable it:

sudo flatpak remote-modify --enable flathub

Then retry the installation command.

Launch Code::Blocks

Launch from Terminal

For DNF installations, launch directly:

codeblocks

Alternatively, for Flatpak installations use:

flatpak run org.codeblocks.codeblocks

Launch from Applications Menu

To launch graphically, navigate through GNOME:

Activities > Show Applications > Code::Blocks

Then click the Code::Blocks icon to launch the IDE.

Verify Compiler Detection

On first launch, Code::Blocks scans for available compilers. If GCC was installed earlier, it should be detected automatically. To verify, navigate to Settings > Compiler > Toolchain executables; GCC paths should be populated. However, if detection failed, you can set them manually.

Troubleshooting: Compiler Not Detected

If Code::Blocks reports “No compiler detected” on first launch, the IDE cannot locate GCC in your system PATH.

First, verify GCC is installed:

gcc --version

If this returns “command not found,” install the compiler:

sudo dnf install gcc gcc-c++ -y

If GCC is installed, check the binary paths:

which gcc g++ gdb
/usr/bin/gcc
/usr/bin/g++
/usr/bin/gdb

Open Code::Blocks, navigate to Settings > Compiler > Toolchain executables, and set the compiler paths manually. Then click Auto-detect and apply changes. For Flatpak installations, ensure the host toolchain (gcc, g++) is installed on your system.

Update and Remove Code::Blocks

Notably, update and removal procedures differ by installation method.

Update Code::Blocks

Update via DNF

For DNF installations, Code::Blocks updates during normal system maintenance:

sudo dnf upgrade --refresh

Update via Flatpak

Conversely, update all Flatpak applications (or target Code::Blocks specifically):

flatpak update
flatpak update org.codeblocks.codeblocks

Remove Code::Blocks

Remove via DNF

To uninstall Code::Blocks and related packages installed via DNF:

sudo dnf remove codeblocks*

Essentially, this command removes all Code::Blocks packages from your system.

Review the DNF transaction summary carefully. The wildcard codeblocks* will remove all related packages including codeblocks-contrib, codeblocks-devel, and codeblocks-contrib-devel. If you plan to develop Code::Blocks plugins later, abort with n and remove only the base package.

Remove via Flatpak

Similarly, uninstall the Flatpak version and its application data:

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

Remove User Configuration Files

The following commands permanently delete your Code::Blocks settings, project configurations, and custom templates. Export any important configurations before proceeding.

For DNF installations, remove the configuration directory:

rm -rf ~/.config/codeblocks/

Likewise, for Flatpak installations, remove the sandboxed data directory:

rm -rf ~/.var/app/org.codeblocks.codeblocks/

Additionally, check for and remove any cache files if present:

rm -rf ~/.cache/codeblocks/

Conclusion

You now have Code::Blocks installed on Fedora with verified compiler integration and contrib plugins. Create your first C or C++ project through File > New > Project, configure debugging symbols in your build target settings, and explore the plugin manager for code completion enhancements. For version control integration, install Git on Fedora; to expand your build system capabilities, review CMake installation or explore the Rust programming language for systems development.

Leave a Comment