How to install GCC (GNU C / C++) compiler – Unix/Linux

If you get errors which representing the missing of GNU C / C++ compiler on your Linux server, you can simply install it by the help of Linux package installer like YUM, Apt-get etc.

Installation of GNU C / C++ compiler on CentOS/Redhat

Here, you can use the YUM package manager for installation.

yum install gcc gcc-c++ autoconf automake

Installation of GNU C / C++ compiler on Ubuntu/Debian

Here, you can use apt-get command instead of YUM.

sudo apt-get install build-essential

To install the gcc and g++ compilers, you will need the build-essential package. This will also install GNU make.
build-essential contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.
That’s it 🙂

Related posts:
1, Suhosin Patch
2, snoopy logger
3, Steps to install VirtualBox
4, Easy way to install Memcached and memcache
5, Install fail2ban

Post navigation

Arunlal Ashok

Cloud Infrastructure / DevOps Engineer. I know her (Linux) since many years. Linux lover. Like to play on Linux console. I started this blog to share and discuss Linux thoughts.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team

3 thoughts on “How to install GCC (GNU C / C++) compiler – Unix/Linux

  1. hello!
    i got this message when install gcc compiler on rhel server, how to solve it? :
    [root@localhost ~]# yum install gcc gcc-c++ autoconf automake
    Loaded plugins: rhnplugin, security
    This system is not registered with RHN.
    RHN support will be disabled.
    Setting up Install Process
    No package gcc available.
    No package gcc-c++ available.
    No package autoconf available.
    No package automake available.
    Nothing to do

  2. When I run this command sudo apt-get install build-essential……… error is occurred named bca is not in the sudoers file!!! Where bca is my root directory…..plj help me????

Leave a Reply

Your email address will not be published. Required fields are marked *