Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I need to install something on Xentos, I found rpm or tar balls.

I want to know what is difference between two.

Also if I need to install something for php but I have installed on different folder, how can i give that php path while using configure command in newly downloaded tar.gz package ?

share|improve this question

migrated from stackoverflow.com Jun 3 '11 at 8:56

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

    
Never heard of Xentos, maybe you mean Centos? –  vtest Jun 3 '11 at 9:31

2 Answers 2

up vote 1 down vote accepted

An RPM is an archive with a lot of special things in it. It's for installing already built software and sometimes source (usually marked as an SRPM, for source RPM). Besides the files itself, it may also have preinstall scripts, postinstall scripts, and also preremove and postremove scripts if you ever want to remove the software. It keeps things tidy by keeping some install info in the RPM db. You need to be root to install, not only because the files (almost always) get installed in places that usually only root has access to, but you need to be root to change the RPM db.

A tarball in general is just an archive. A collection of files and directories. What you have is a source tarball, one that you need to configure and run for your specific install. Once you extract the tarball (tar -xzvf /path/to/something.tar.gz will extract it). Most software uses something called autoconf which generates a script called configure which can configure your source for building. It does some checks (do you have a compiler? are your libraries new enough?) and can take some command line flags. Use configure --help to see what these flags are. Usually the only flag you need is --prefix=/path/to/somewhere to say where you want to install. Once you run configure you can run make && make install to install it. Or, sudo make install if you are using root only locations.

Anything past the prefix=... flag is very dependent on your source, and what pre-exists on your computer. I don't know your package, nor do I know how php connects to it. Does configure --help list any flags for php path? Sometimes you just put the interpreter into your PATH e.g. PATH=/path/to/php/bin:$PATH. The configure script then (may) find php and query it (things that use perl work this way). You may need some post build configuration after. Be prepared to experiment.

Since you said you have things in non-standard locations, your choice may just be the source tarball. RPMs are prebuilt, and tend to have few options for configuration.

share|improve this answer

RPM is a pre-made package - you can use either a graphical tool or rpm (CLI) to install it.

Tarballs are source code. You can usually get away with just running

./configure && make && make install

If you need to change the install path of a package, do something like this:

./configure --prefix=/this/is/where/everything/goes && make && sudo make install

(or use su -c: I'm a Zenwalker and can't really say which is preferred on RH based distros)

which will end up with a directory tree like:

/this/is/.../goes/bin
/this/is/.../goes/doc
/this/is/.../goes/share

If this is not what you want in regards to chaging the install path, feel free to be more specific, as ./configure has the following path options:

Fine tuning of the installation directories:

--bindir=DIR user executables [EPREFIX/bin]

--sbindir=DIR system admin executables [EPREFIX/sbin]

--libexecdir=DIR program executables [EPREFIX/libexec]

--sysconfdir=DIR read-only single-machine data [PREFIX/etc]

--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]

--localstatedir=DIR modifiable single-machine data [PREFIX/var]

--libdir=DIR object code libraries [EPREFIX/lib]

--includedir=DIR C header files [PREFIX/include]

--oldincludedir=DIR C header files for non-gccv[/usr/include]

--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]

--datadir=DIR read-only architecture-independent data [DATAROOTDIR]

--infodir=DIR info documentation [DATAROOTDIR/info]

--localedir=DIR locale-dependent data [DATAROOTDIR/locale]

--mandir=DIR man documentation [DATAROOTDIR/man]

--docdir=DIR documentation root [DATAROOTDIR/doc/bullet]

--htmldir=DIR html documentation [DOCDIR]

--dvidir=DIR dvi documentation [DOCDIR]

--pdfdir=DIR pdf documentation [DOCDIR]

--psdir=DIR ps documentation [DOCDIR]

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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