Saturday, December 28, 2024
Google search engine
HomeGuest BlogsInstall GCC and Development Tools on RHEL 8 / CentOS 8

Install GCC and Development Tools on RHEL 8 / CentOS 8

How do I install Development Tools on RHEL 8 / 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
  • pkgconf–pkg-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 
....
Available Environment Groups:
   Server with GUI
   Server
   Workstation
   Virtualization Host
   Custom Operating System
Installed Environment Groups:
   Minimal Install
Available Groups:
   Container Management
   .NET Core Development
   RPM Development Tools
   Development Tools
   Graphical Administration Tools
   Headless Management
   Legacy UNIX Compatibility
   Network Servers
   Scientific Support
   Security Tools
   Smart Card Support
   System 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
Last metadata expiration check: 0:08:05 ago on Thu 17 Aug 2023 07:21:15 PM UTC.
Available Groups: 12

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" -y

Or with the command below:

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.gz /usr/share/info/flex.info-1.gz /usr/share/info/flex.info-2.gz

Check installed GCC version.

$ gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10)
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.

$ vim  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

RELATED ARTICLES

Most Popular

Recent Comments