Can't Install build-essential on CentOS

When I run the command:

sudo apt-get install build-essential

I get the following error message:

Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package build-essential
Asked By: Waley Chen

sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
Answered By: Waley Chen

I believe this still should work.

sudo yum groupinstall 'Development Tools'
Answered By: Scott Likens
yum install gcc gcc-c++ make 

This works equivalent of build-essential in CentOS.

Answered By: KK Patel

The metapackage build-essential is provided on Debian to collect all the commonly required essential build tools in the Debian build chain, including those you need to create .deb packages. Centos uses a different package manager altogether and does not directly provide anything like this; you’ll need to manually install the individual components of the toolchain (gcc, make, common development libraries, documentation, etc, as well as of course the tools to create RPM packages if you want to do that).

If you drop the .deb or RPM stuff, gcc, gcc-c++, glibc-devel, and make should get the corresponding Centos packages currently.

Answered By: tripleee

I combined accepted solution from Scott Likens with the comment from user12345, and first looked at what was in the “Development Tools” group before installing.

As user12345 pointed out, you can do this with:

$ yum group info "Development Tools"

I did want to install packages like autoconf and automake and binutils, but I did not need doxygen or ant or mercurial.

Below is the list I used, along with their dependencies, but of course, your mileage may vary, depending upon YOUR needs.

$ yum install 
    autoconf automake binutils 
    bison flex gcc gcc-c++ gettext 
    libtool make patch pkgconfig 
    redhat-rpm-config rpm-build rpm-sign 
    ctags elfutils indent patchutils 
Answered By: m0j0
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.