110

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
Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Waley Chen
  • 1,253
  • 2
    What distro (Ubuntu? Debian?) and version? What repo? –  Jul 10 '11 at 22:10
  • Linux version 2.6.18-028stab070.14 (root@rhel5-build-x64) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Nov 18 16:04:02 MSK 2010 Is that correct ? –  Jul 10 '11 at 22:14
  • CentOS release 5.5 (Final) –  Jul 10 '11 at 22:17
  • 2
    Are you running a Red Hat kernel on a Debian or Ubuntu distribution? Or are you actually running a Red Hat distribution? If you're running a Red Hat distribution, then you should be using yum or up2date (whichever is appropriate for your distribution version). – sarnold Jul 10 '11 at 22:18
  • 1
    Thanks for all your help guys! Googling how to install build-essential for CentOS pointed me in the right direction. – Waley Chen Jul 10 '11 at 22:52
  • 1
    Here's the cmd: sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel – Waley Chen Jul 10 '11 at 22:54
  • 1
    don't forget to add that as an answer and accept it once the stack software lets you do that. :) – sarnold Jul 10 '11 at 23:59
  • 1
    @Waley The command you post is to install xml and xslt development libraries. As a side effect it will install gcc. Something more in the spirit of debian's build-essential will be sudo yum install gcc gcc-cpp make rpm-build – Pablo Castellazzi Jul 11 '11 at 05:01

5 Answers5

176

I believe this still should work.

sudo yum groupinstall 'Development Tools'
Scott Likens
  • 1,876
  • 8
    this will install every single development tools available, just FYI – user2720864 Jul 01 '14 at 08:19
  • 5
    See yum group info "Development Tools" for list of packages installed – user12345 Apr 11 '16 at 22:49
  • 2
    It's a long way short of all development tools, in case you're worried. It's mostly the basics for c/c++ with automake, autoconf etc. – Barry Kelly Feb 06 '17 at 17:46
  • 1
    But if you only need a configure/make/make install to work it may still be too much (e.g. it includes git and subversion). It's better to start with Ketan Patel's yum install and if something is still missing go for this one – ndemou Feb 12 '17 at 19:47
  • it depends on the "programming language" needed, but if you expect to compile c++, you'll need in PLUS glibc-devel and maybe make... yum groups are soooo shitty ! – Sandburg May 02 '19 at 13:28
72
yum install gcc gcc-c++ make 

This works equivalent of build-essential in CentOS.

KK Patel
  • 1,855
  • 5
    openssl-devel might coincidentally pull in the stuff you want, but isn't properly build-essential itself. – tripleee Jun 17 '17 at 17:26
  • @tripleee Indeed. Good catch, make and cmake will definitely will need this. By the way I would like to add that some times I also need to install separately : glibc-devel.i686 libstdc++-devel.i686 openssl-devel.i686 , in order to have a 64bit build. – Tsakiroglou Fotis Jul 10 '20 at 08:57
8

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.

tripleee
  • 7,699
3

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 
m0j0
  • 803
1
sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
Kevin
  • 40,767
Waley Chen
  • 1,253