How To Install gcc on Rocky Linux 8
Introduction
In this tutorial we learn how to install gcc
on Rocky Linux 8.
What is gcc
The gcc package contains the GNU Compiler Collection version 8. You’ll need this package in order to compile C code.
We can use yum
or dnf
to install gcc
on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install gcc.
Install gcc on Rocky Linux 8 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
After updating yum database, We can install gcc
using dnf
by running the following command:
sudo dnf -y install gcc
Install gcc on Rocky Linux 8 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
After updating yum database, We can install gcc
using yum
by running the following command:
sudo yum -y install gcc
How To Uninstall gcc on Rocky Linux 8
To uninstall only the gcc
package we can use the following command:
sudo dnf remove gcc
gcc Package Contents on Rocky Linux 8
/usr/bin/c89
/usr/bin/c99
/usr/bin/cc
/usr/bin/gcc
/usr/bin/gcc-ar
/usr/bin/gcc-nm
/usr/bin/gcc-ranlib
/usr/bin/gcov
/usr/bin/gcov-dump
/usr/bin/gcov-tool
/usr/bin/x86_64-redhat-linux-gcc
/usr/bin/x86_64-redhat-linux-gcc-8
/usr/lib/.build-id
/usr/lib/.build-id/09
/usr/lib/.build-id/09/5b87f7b7ec67cf2733dd83311f2aa96fb69034
/usr/lib/.build-id/23
/usr/lib/.build-id/23/cbf514426481aa8d141e5303c0ee3e268fde28
/usr/lib/.build-id/2b
/usr/lib/.build-id/2b/6ae6fc611ceb0a9f0bb286b55acf446091bbba
/usr/lib/.build-id/61
/usr/lib/.build-id/61/c5f16f772703f929f2c87c4174056af942158b
/usr/lib/.build-id/75
/usr/lib/.build-id/75/ecd3984c4970c8d4f811ff015ddb8f40e3cbfa
/usr/lib/.build-id/93
/usr/lib/.build-id/93/0f60132142b398cd265ecaf732daa8321bec08
/usr/lib/.build-id/9c
/usr/lib/.build-id/9c/dbac54a0c543f5b75b5bd2dbcd1b56620081ff
/usr/lib/.build-id/a0
/usr/lib/.build-id/a0/16ea8d3ae4cea7a77c3356a01b6a82663cc14b
/usr/lib/.build-id/aa
/usr/lib/.build-id/aa/75b49c00ecd2a3b8e2898a7818e27daf1fe492
/usr/lib/.build-id/c1
/usr/lib/.build-id/c1/ffd04b43891fdbd8c7addc2e34e771212cc809
/usr/lib/.build-id/c1/ffd04b43891fdbd8c7addc2e34e771212cc809.1
/usr/lib/.build-id/c1/ffd04b43891fdbd8c7addc2e34e771212cc809.2
/usr/lib/.build-id/e5
/usr/lib/.build-id/e5/888c305b35d824e2545720164427ad4b3dd825
/usr/lib/gcc
/usr/lib/gcc/x86_64-redhat-linux
/usr/lib/gcc/x86_64-redhat-linux/8
/usr/lib/gcc/x86_64-redhat-linux/8/32
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtbegin.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtbeginS.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtbeginT.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtfastmath.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtoffloadbegin.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtoffloadend.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtoffloadtable.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtprec32.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtprec64.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/crtprec80.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/libasan.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libasan_preinit.o
/usr/lib/gcc/x86_64-redhat-linux/8/32/libatomic.a
/usr/lib/gcc/x86_64-redhat-linux/8/32/libatomic.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgcc.a
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgcc_eh.a
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgcc_s.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgcov.a
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgomp.a
/usr/lib/gcc/x86_64-redhat-linux/8/32/libgomp.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libitm.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libquadmath.so
/usr/lib/gcc/x86_64-redhat-linux/8/32/libubsan.so
/usr/lib/gcc/x86_64-redhat-linux/8/crtbegin.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtbeginS.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtbeginT.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtfastmath.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtoffloadbegin.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtoffloadend.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtoffloadtable.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtprec32.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtprec64.o
/usr/lib/gcc/x86_64-redhat-linux/8/crtprec80.o
/usr/lib/gcc/x86_64-redhat-linux/8/include
/usr/lib/gcc/x86_64-redhat-linux/8/include/adxintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/ammintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx2intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx5124fmapsintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx5124vnniwintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bitalgintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512bwintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512cdintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512dqintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512erintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512fintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512ifmaintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512ifmavlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512pfintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vbmi2intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vbmi2vlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vbmiintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vbmivlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vlbwintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vldqintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vnniintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vnnivlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vpopcntdqintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avx512vpopcntdqvlintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/avxintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/bmi2intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/bmiintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/bmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/cet.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/cetintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/clflushoptintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/clwbintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/clzerointrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/cpuid.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/cross-stdarg.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/emmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/f16cintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/float.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/fma4intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/fmaintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/fxsrintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/gcov.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/gfniintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/ia32intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/immintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/iso646.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/limits.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/lwpintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/lzcntintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/mm3dnow.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/mm_malloc.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/mmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/movdirintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/mwaitxintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/nmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/omp.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/openacc.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/pconfigintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/pkuintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/pmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/popcntintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/prfchwintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/rdseedintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/rtmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/sanitizer
/usr/lib/gcc/x86_64-redhat-linux/8/include/sanitizer/asan_interface.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/sanitizer/common_interface_defs.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/sanitizer/lsan_interface.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/sanitizer/tsan_interface.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/sgxintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/shaintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/smmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdalign.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdarg.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdatomic.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdbool.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stddef.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdfix.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdint-gcc.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/stdnoreturn.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/syslimits.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/tbmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/tmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/unwind.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/vaesintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/varargs.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/vpclmulqdqintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/wbnoinvdintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/wmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/x86intrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xmmintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xopintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xsavecintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xsaveintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xsaveoptintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xsavesintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/include/xtestintrin.h
/usr/lib/gcc/x86_64-redhat-linux/8/libasan.so
/usr/lib/gcc/x86_64-redhat-linux/8/libasan_preinit.o
/usr/lib/gcc/x86_64-redhat-linux/8/libatomic.so
/usr/lib/gcc/x86_64-redhat-linux/8/libgcc.a
/usr/lib/gcc/x86_64-redhat-linux/8/libgcc_eh.a
/usr/lib/gcc/x86_64-redhat-linux/8/libgcc_s.so
/usr/lib/gcc/x86_64-redhat-linux/8/libgcov.a
/usr/lib/gcc/x86_64-redhat-linux/8/libgomp.a
/usr/lib/gcc/x86_64-redhat-linux/8/libgomp.so
/usr/lib/gcc/x86_64-redhat-linux/8/libgomp.spec
/usr/lib/gcc/x86_64-redhat-linux/8/libitm.spec
/usr/lib/gcc/x86_64-redhat-linux/8/liblsan.so
/usr/lib/gcc/x86_64-redhat-linux/8/liblsan_preinit.o
/usr/lib/gcc/x86_64-redhat-linux/8/libsanitizer.spec
/usr/lib/gcc/x86_64-redhat-linux/8/libtsan.so
/usr/lib/gcc/x86_64-redhat-linux/8/libtsan_preinit.o
/usr/lib/gcc/x86_64-redhat-linux/8/libubsan.so
/usr/lib/gcc/x86_64-redhat-linux/8/rpmver
/usr/libexec/gcc
/usr/libexec/gcc/x86_64-redhat-linux
/usr/libexec/gcc/x86_64-redhat-linux/8
/usr/libexec/gcc/x86_64-redhat-linux/8/collect2
/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so
/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so.0
/usr/libexec/gcc/x86_64-redhat-linux/8/liblto_plugin.so.0.0.0
/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
/usr/libexec/gcc/x86_64-redhat-linux/8/lto1
/usr/libexec/getconf/default
/usr/share/doc/gcc
/usr/share/doc/gcc/ChangeLog-1997.bz2
/usr/share/doc/gcc/ChangeLog-1998.bz2
/usr/share/doc/gcc/ChangeLog-1999.bz2
/usr/share/doc/gcc/ChangeLog-2000.bz2
/usr/share/doc/gcc/ChangeLog-2001.bz2
/usr/share/doc/gcc/ChangeLog-2002.bz2
/usr/share/doc/gcc/ChangeLog-2003.bz2
/usr/share/doc/gcc/ChangeLog-2004.bz2
/usr/share/doc/gcc/ChangeLog-2005.bz2
/usr/share/doc/gcc/ChangeLog-2006.bz2
/usr/share/doc/gcc/ChangeLog-2007.bz2
/usr/share/doc/gcc/ChangeLog-2008.bz2
/usr/share/doc/gcc/ChangeLog-2009.bz2
/usr/share/doc/gcc/ChangeLog-2010.bz2
/usr/share/doc/gcc/ChangeLog-2011.bz2
/usr/share/doc/gcc/ChangeLog-2012.bz2
/usr/share/doc/gcc/ChangeLog-2013.bz2
/usr/share/doc/gcc/ChangeLog-2014.bz2
/usr/share/doc/gcc/ChangeLog-2015.bz2
/usr/share/doc/gcc/ChangeLog-2016.bz2
/usr/share/doc/gcc/ChangeLog-2017.bz2
/usr/share/doc/gcc/ChangeLog.bz2
/usr/share/doc/gcc/ChangeLog.dataflow.bz2
/usr/share/doc/gcc/ChangeLog.gimple-classes.bz2
/usr/share/doc/gcc/ChangeLog.graphite.bz2
/usr/share/doc/gcc/ChangeLog.jit.bz2
/usr/share/doc/gcc/ChangeLog.lib.bz2
/usr/share/doc/gcc/ChangeLog.ptr.bz2
/usr/share/doc/gcc/ChangeLog.tree-ssa.bz2
/usr/share/doc/gcc/ChangeLog.tuples.bz2
/usr/share/doc/gcc/README.Portability
/usr/share/info/gcc.info.gz
/usr/share/info/gccinstall.info.gz
/usr/share/info/gccint.info.gz
/usr/share/licenses/gcc
/usr/share/licenses/gcc/COPYING
/usr/share/licenses/gcc/COPYING.LIB
/usr/share/licenses/gcc/COPYING.RUNTIME
/usr/share/licenses/gcc/COPYING3
/usr/share/licenses/gcc/COPYING3.LIB
/usr/share/locale/be/LC_MESSAGES/gcc.mo
/usr/share/locale/da/LC_MESSAGES/gcc.mo
/usr/share/locale/de/LC_MESSAGES/gcc.mo
/usr/share/locale/el/LC_MESSAGES/gcc.mo
/usr/share/locale/es/LC_MESSAGES/gcc.mo
/usr/share/locale/fi/LC_MESSAGES/gcc.mo
/usr/share/locale/fr/LC_MESSAGES/gcc.mo
/usr/share/locale/hr/LC_MESSAGES/gcc.mo
/usr/share/locale/id/LC_MESSAGES/gcc.mo
/usr/share/locale/ja/LC_MESSAGES/gcc.mo
/usr/share/locale/nl/LC_MESSAGES/gcc.mo
/usr/share/locale/ru/LC_MESSAGES/gcc.mo
/usr/share/locale/sr/LC_MESSAGES/gcc.mo
/usr/share/locale/sv/LC_MESSAGES/gcc.mo
/usr/share/locale/tr/LC_MESSAGES/gcc.mo
/usr/share/locale/uk/LC_MESSAGES/gcc.mo
/usr/share/locale/vi/LC_MESSAGES/gcc.mo
/usr/share/locale/zh_CN/LC_MESSAGES/gcc.mo
/usr/share/locale/zh_TW/LC_MESSAGES/gcc.mo
/usr/share/man/man1/gcc.1.gz
/usr/share/man/man1/gcov-dump.1.gz
/usr/share/man/man1/gcov-tool.1.gz
/usr/share/man/man1/gcov.1.gz
References
Summary
In this tutorial we learn how to install gcc
on Rocky Linux 8 using yum and dnf.