67

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

migrated from stackoverflow.com Jul 10 '11 at 22:21

This question came from our site for professional and enthusiast programmers.

  • 1
    What distro (Ubuntu? Debian?) and version? What repo? – Dirk Eddelbuettel Jul 10 '11 at 22:10
  • 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
110

I believe this still should work.

sudo yum groupinstall 'Development Tools'
  • 5
    this will install every single development tools available, just FYI – user2720864 Jul 1 '14 at 8:19
  • 3
    See yum group info "Development Tools" for list of packages installed – user12345 Apr 11 '16 at 22:49
  • 1
    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 6 '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 2 at 13:28
43
yum install gcc gcc-c++ make 

This works equivalent of build-essential in CentOS.

  • 2
    openssl-devel might coincidentally pull in the stuff you want, but isn't properly build-essential itself. – tripleee Jun 17 '17 at 17:26
4

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.

1

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 
0
sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
  • This seems more of a side-effect as @pablo-castellazzi mentioned in comments in your question section. Better answer imo is by K.K. Patel or Scott Likens – user12345 Apr 11 '16 at 22:44
  • 2
    The command you post asks to install xml and xslt development libraries. As a side effect it will install gcc which is an essential building tool. – ndemou Feb 12 '17 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.