How to Install Development Tools on Rocky Linux 10, 9 and 8

Install Development Tools on Rocky Linux with the DNF development group, then verify gcc, make, RPM tooling, optional build helpers, and cleanup steps before removing the shared compiler stack.

PublishedAuthorJoshua JamesRead time6 minGuide typeRocky Linux

Source builds fail quickly when a Rocky Linux system is missing a compiler, Make, development headers, or RPM macros. Install Development Tools on Rocky Linux with the development DNF group when you need a standard C and C++ toolchain for local builds, package work, driver prerequisites, or CI-style compile checks.

The group display name is Development Tools, and DNF also resolves that quoted name. The stable group ID is development, so the commands below use the ID across Rocky Linux 10, 9, and 8 instead of relying on display-name or localization behavior.

Install Development Tools on Rocky Linux

Review the Rocky Linux Build Tool Packages

Rocky Linux splits development tooling across package groups and individual packages. The main group installs the compiler stack and RPM build basics, while project-specific tools should stay explicit so you do not add more packages than your workflow needs.

Package or GroupWhat It AddsUse It When
developmentgcc, gcc-c++, make, gdb, glibc-devel, rpm-build, redhat-rpm-config, Git, patch utilities, and related build toolsYou need the normal Rocky Linux compiler and RPM build baseline.
rpm-development-toolsrpmdevtools plus RPM build helpersYou create spec files, source RPMs, or local RPM package trees.
cmakeCMake project configuration and build generation toolsA project uses CMakeLists.txt or asks for CMake during configuration.
elfutils-libelf-devellibelf headers used by some kernel-module and low-level build workflowsA build log reports missing libelf headers; check first because some group transactions already install it.
kernel-headers and kernel-develUserspace kernel headers and the active kernel build treeYou build DKMS modules, NVIDIA drivers, VirtualBox modules, or other external kernel modules.

The default build group does not require EPEL, CRB, or PowerTools on Rocky Linux. Add EPEL only when a separate package such as dkms is part of the workflow.

Do not confuse this DNF group with Rocky Devtools from the official Rocky Packaging and Developer Guide. Rocky Devtools includes helpers such as rockyget, rockybuild, rockypatch, and rockyprep for fetching SRPMs and rebuilding Rocky packages. Those helpers rely on tools such as Git, Make, Go, and rpmbuild, but they are a separate packaging workflow, not a prerequisite for ordinary source builds.

Update Rocky Linux Before Installing Development Tools

Refresh package metadata and apply pending updates before installing the toolchain. This keeps BaseOS and AppStream package metadata aligned before DNF resolves the group transaction.

sudo dnf upgrade --refresh

These package-management commands use sudo because they change system packages. If repository metadata downloads slowly, tune DNF with the Rocky-specific steps to increase DNF speed on Rocky Linux before retrying large transactions.

Inspect the Development Tools Group

Check the group before installing it. The command is read-only and shows the packages Rocky exposes through the development group on your enabled repositories.

dnf group info development

The output should identify the group as Development Tools. Rocky Linux merges matching group metadata from BaseOS and AppStream, so the visible package set can include packages from both repositories.

Install the Development Tools Group

Install the mandatory and default packages from the build group with the group ID:

sudo dnf group install development

DNF prompts before changing packages. Review the transaction, especially on shared build hosts where Git, RPM tools, kernel build packages, and debug utilities may already be installed from earlier work. If DNF proposes unexpected removals or downgrades, stop and inspect the enabled repositories before confirming the group install.

Add Optional Build Helpers

Install RPM packaging helpers when you need rpmdev-setuptree, spec-file templates, and source RPM workspace helpers:

sudo dnf group install rpm-development-tools

Add CMake only when a project asks for it. For a full CMake workflow, use the dedicated article to install CMake on Rocky Linux instead of treating it as a silent prerequisite for every build.

sudo dnf install cmake

Install libelf headers only when a build log names them as missing. Check first because Rocky 8 lists elfutils-libelf-devel in the default group set, while Rocky 10 and 9 can pull it in through related build dependencies even though it is not listed as a default group package.

rpm -q elfutils-libelf-devel

If the package query reports that elfutils-libelf-devel is not installed, add it with DNF:

sudo dnf install elfutils-libelf-devel

Kernel module builds need packages that match the active kernel. Run the verification check first because the build-tool transaction can already install kernel-headers and a matching kernel-devel package on Rocky Linux 10, 9, or 8. For DKMS, NVIDIA, VirtualBox, or other module builds, install Linux kernel headers on Rocky Linux if the verification check fails before running the module installer.

Verify Development Tools on Rocky Linux

Check the Installed Compiler Packages

Confirm the key commands and RPM packages are installed. Version numbers can differ between Rocky Linux releases and update levels, so the important result is that each command prints a version and each package query returns an installed package.

gcc --version
g++ --version
make --version
rpmbuild --version
rpm -q gcc gcc-c++ make gdb glibc-devel rpm-build redhat-rpm-config

If you installed RPM packaging helpers, verify the helper command as well:

command -v rpmdev-setuptree
rpm -q rpmdevtools

Build a Small C Program with Make

A small compile test proves that gcc, Make, and the standard C headers work together, not only that the packages are installed.

mkdir -p ~/development-tools-smoke-test
cd ~/development-tools-smoke-test

cat > hello.c <<'EOF'
#include <stdio.h>

int main(void) {
    puts("Build tools work");
    return 0;
}
EOF

cat > Makefile <<'EOF'
hello: hello.c
	gcc -Wall -Wextra -O2 -o hello hello.c

clean:
	rm -f hello
EOF

make
./hello

Expected output includes the compiler command from Make and the program message:

gcc -Wall -Wextra -O2 -o hello hello.c
Build tools work

Clean up the temporary test project after the check passes:

make clean
cd ~
rm -rf ~/development-tools-smoke-test

Use Development Tools on Rocky Linux

The installed toolchain covers common local development tasks, but the right first command depends on the project type.

TaskUseful CheckWhat to Install If Missing
Compile C projectsgcc --version and make --versiondevelopment group
Compile C++ projectsg++ --versiondevelopment group or gcc-c++
Configure CMake projectscmake --versioncmake
Build RPM packagesrpmbuild --version and command -v rpmdev-setuptreedevelopment group; add rpm-development-tools for rpmdev-setuptree
Build kernel modulesrpm -q "kernel-devel-$(uname -r)"kernel-headers and matching kernel-devel

The development group also installs Git in the default package set. If you need Git-specific setup, source-build Git, or GUI tools, use the separate workflow to install Git on Rocky Linux.

Update or Remove Development Tools on Rocky Linux

Update Build Tool Packages

Normal DNF upgrades update installed compiler, debugger, Git, and RPM build packages. The group upgrade command also lets DNF add packages that Rocky later adds to the group definition.

sudo dnf upgrade --refresh
sudo dnf group upgrade development

Use the same pattern for the RPM helper group if you installed it:

sudo dnf group upgrade rpm-development-tools

Remove Development Tools

Group removal can remove packages that are not marked as explicitly installed and are not required by another installed group. Review the DNF transaction before confirming, especially on a workstation that still builds software, kernel modules, or RPM packages.

Remove the main build group only when the system no longer needs the shared compiler stack:

sudo dnf group remove development

Remove optional build helpers only if you installed them for this workflow and no other project uses them:

sudo dnf group remove rpm-development-tools
sudo dnf remove cmake elfutils-libelf-devel

If DNF reports that an optional package is not installed, continue to the verification check. The main group removal may have already removed packages that were pulled in as dependencies.

Remove kernel build packages only when no driver, DKMS module, VirtualBox module, or other external module workflow still needs them:

sudo dnf remove kernel-headers "kernel-devel-$(uname -r)"

Check whether core or optional build packages remain installed. A remaining package can be normal when another group, project, driver, or manual install still owns it.

rpm -q gcc gcc-c++ make gdb glibc-devel rpm-build redhat-rpm-config || true
rpm -q rpmdevtools cmake elfutils-libelf-devel kernel-headers "kernel-devel-$(uname -r)" || true

Troubleshoot Development Tools on Rocky Linux

DNF Cannot Find the Development Tools Group

A group lookup failure usually means DNF is not seeing the expected BaseOS or AppStream group metadata. Check the group IDs and enabled repositories first:

dnf group list --ids | grep -E 'development|rpm-development-tools'
dnf repolist --enabled | grep -E '^(appstream|baseos)[[:space:]]'

If the repositories are enabled but the group still does not appear, refresh metadata and retry the group install:

sudo dnf clean metadata
sudo dnf makecache
sudo dnf group install development

Group Is Installed But gcc or make Is Missing

A group can be marked installed without every package being present if someone used dnf group mark install or removed individual packages later. Check package state before changing anything:

rpm -q gcc gcc-c++ make
dnf group info development

Reinstall missing group packages, then let DNF align the installed group with the current Rocky definition:

sudo dnf group install development
sudo dnf group upgrade development
rpm -q gcc gcc-c++ make

Do not use dnf group mark install development as a repair command. It changes the group state only; it does not install missing compiler packages.

CMake or libelf Headers Are Missing

The main group does not install every optional build helper on every release, and dependency choices can change with repository state. Check the missing tool or header package first:

command -v cmake || echo "cmake is not installed"
rpm -q elfutils-libelf-devel || true

Run only the install line that matches your build log:

sudo dnf install cmake
sudo dnf install elfutils-libelf-devel

Retest the package or command that matched your build error:

cmake --version
rpm -q elfutils-libelf-devel

Verify kernel-devel for Kernel Module Builds

External kernel modules need the build tree for the running kernel. Check the active kernel and matching package before rerunning a driver or DKMS installer:

uname -r
rpm -q "kernel-devel-$(uname -r)" kernel-headers

If the matching package is missing, install it from Rocky repositories. If the command already reports an installed package, continue with the driver or module build instead of reinstalling it. If the build also needs dkms, enable EPEL on Rocky Linux first because DKMS is not part of the default Rocky repositories.

sudo dnf install kernel-headers "kernel-devel-$(uname -r)"

Retest the active kernel build tree before rerunning the module installer:

rpm -q "kernel-devel-$(uname -r)" kernel-headers
test -d "/usr/src/kernels/$(uname -r)" && echo "Matching kernel-devel tree found"

Conclusion

Rocky Linux now has a verified compiler and RPM build baseline from the development group, with optional helpers separated for CMake, RPM packaging, libelf headers, and kernel-module workflows. Keep the group updated with DNF, and remove it only after checking that no local projects, drivers, or package builds still depend on the shared toolchain.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show our tutorials more often in Top Stories and mark them as preferred in AI Mode and AI Overviews when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<a href="https://example.com">link</a> link
<blockquote>quote</blockquote> quote block

Add to the discussion

Questions, fixes, command output, and version notes help keep this guide current.

Verify before posting: