(Last Updated On: March 17, 2019)

How do I install Development Tools on RHEL / CentOS 8?. RHEL based distributions are designed for enterprise and running mission-critical applications. It is the most stable and secure Server Operating System. For security reasons and performance, they often ship with fewer packages pre-installed.

If you want to do Development or build open source applications on RHEL / CentOS 8, you need to install Development tools which include the following tools.

  • autoconf
  • automake
  • gcc
  • gcc-c++
  • bison
  • flex
  • binutils
  • gdb
  • glibc-devel
  • libtool
  • make
  • pkgconf
  • pkgconf-m4
  • pkgconfpkg-config
  • redhat-rpm-config
  • rpm-build
  • rpm-sign
  • strace

List package groups on a CentOS / RHEL 8

Type the following dnf command to list package groups available on your CentOS / RHEL 8.

$ dnf group list 
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:02:38 ago on Sun 17 Mar 2019 09:28:36 AM EAT.
Available Environment Groups:
Minimal Install
Workstation
Custom Operating System
Installed Environment Groups:
Server
Installed Groups:
Container Management
Development Tools
Available Groups:
.NET Core Development
RPM Development Tools
Smart Card Support
Scientific Support
Security Tools
System Tools
Headless Management
Network Servers
Legacy UNIX Compatibility
Graphical Administration Tools

You can pass the summary option to view the number of installed groups, available groups, available environment groups, and both installed and available language groups:

$ sudo dnf groups summary
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Last metadata expiration check: 0:06:33 ago on Sun 17 Mar 2019 09:28:36 AM EAT.
Installed Groups: 2
Available Groups: 10

Install GCC and Development Tools on a CentOS / RHEL 8 server

The following command is used to install GCC and Development Tools on a CentOS / RHEL 8 server.

sudo dnf group install "Development Tools"

OR

sudo dnf groupinstall "Development Tools"

You can view information on the Development Tools package group.

sudo dnf group info "Development Tools"

Verify installation by checking tools binary locations.

$ whereis bison gcc flex
bison: /usr/bin/bison /usr/share/bison /usr/share/man/man1/bison.1.gz /usr/share/info/bison.info.gz
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz /usr/share/info/gcc.info.gz
flex: /usr/bin/flex /usr/share/man/man1/flex.1.gz /usr/share/info/flex.info-1.gz /usr/share/info/flex.info-2.gz /usr/share/info/flex.info.gz

Check installed GCC version.

$ gcc --version
gcc (GCC) 8.2.1 20180905 (Red Hat 8.2.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make --version
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Uninstalling GCC and Development Tools on a CentOS / RHEL 8 server

Below is the command used to remove a Package Group on CentOS / RHEL 8.

sudo dnf group remove "Development Tools"

Be keen on dependency tree to avoid breaking other system packages.

Test GCC Compiler

Let’s create a Hello World program to see if it compiles properly.

$ cat  hello.c

#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}

Compile the code with GCC.

gcc hello.c -o helloworld

Run the program to see if it prints Hello, world!.

$ ./helloworld 
Hello, world!

Thank you for installing GCC and Development Tools on RHEL / CentOS 8 using our guide. You can check other RHEL/CentOS 8 guides available in our blog.

Install MyWebSQL on RHEL / CentOS 8

How to Install Scala on RHEL / CentOS 8

How to Install Zabbix Server on RHEL 8 / CentOS 8

How to Install Netdata on RHEL / CentOS 8