I am researching how to install Ruby 1.9.1 in Xubuntu 10.04 and I came across the command build-essential and build-dep multiple times. Sometimes it is followed by packages and sometimes it is both preceded and post-ceded by packages.

3 Answers
3

The build-essentials is a reference for all the packages needed to compile a debian package. It generally includes the gcc/g++ compilers an libraries and some other utils. Check the documentation: Here!

Ok but that still does not answer my question fully. I understand that 'build-essential' contains an informational list of packages which are essential for creating Debian packages. But what is considered a Debian package? Ruby? gcc/g++ compilers? And how does Debian packages and 'build-essential" relate to Ruby? Is Ruby built on top of the Debian package? Put another way, does Ruby need the build-essential package to run? I really wish to see a visual representation of the relationships between all these parts.
–
classerJun 10 '10 at 22:00

1

To put it simply, if you ( or some other package you want to install ) need a C/C++ compiler, you need to install build-essential. Usually it's the first thing I install in a new Ubuntu installation :-)
–
IsmaelJun 10 '10 at 23:13

@Adam Since Ruby is an interpreted language, the interpreter needs the C or C++ compiler to build itself to run on your machine. build-essential is a metapackage (a package that installs many other packages, like g++ and gcc: the GNU C & C++ compilers). It's required if you want to compile anything from source, and if you want to work with almost any programming language. HTH!
–
squircleJun 11 '10 at 20:03

The command sudo apt-get build-dep packagename means "As root, install all dependencies for 'packagename' so that I can build it". So build-dep is an apt-get command just like install, remove, update, etc.

build-essential is a package which contains references to numerous packages needed for building software in general.

Thanks for explaining the 'build-dep' command. So as I understand it, in this case Ruby1.9 has a dependency list attached to it that Linux looks to as a 'To Do/Build List' and one by one builds each of those items. The final infrastructure that gets built allows Ruby1.9 to function properly. What I do not understand is why 'build-essential' ,or all of the other packages in the top line( zlib1g zlib1g-dev zlibc libruby1.9 etc. etc.), would not be included in the 'To Do/Build List' attached to Ruby1.9. Wouldn't it be simpler if there was just one command?
–
classerJun 10 '10 at 22:11