General
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between .src and .rpm packages

SOLVED
Go to solution
ben10_1
Regular Advisor

What is the difference between .src and .rpm packages

Hi Forum,

I just trying to find the diference between the .src and .rpm packages on linux.

Are they the same? why do we have .src if .rpm will do the job?

Many Thanks.
3 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: What is the difference between .src and .rpm packages

A .src package needs to be compiled before it will be useful. To do that, you need to have a compiler in your system, and also all the -dev packages for the libraries required by the package. So installing a .src needs a bit more work and some knowledge about how to use a compiler.

On the other hand, a .src package is not dependent on the exact library versions, so one .src package can cover all distributions. You can also modify the installation location and compile-time options, so for example if you're building an embedded system for a special purpose (e.g. a mini-PC that would work as a car navigator), you can strip out some functions you won't need, giving you smaller binaries and allowing you to run the program with minimal RAM.

A source package can also be compiled for multiple hardware architectures: the same source package can be used to compile a binary for PC hardware, a PowerMac running Linux, or an IBM mainframe running Linux in a hardware partition.

A .rpm package is compiled for a certain hardware architecture and distribution version. It depends on finding the required library versions at known locations. A RPM package will also install the binaries at the location defined at package creation time: if the software has been packaged to install to /opt, you cannot easily modify it to install to /usr/local/bin, for example.

Trying to install a .rpm that is meant for a different distribution may sometimes be successful, but in other times it can lead to a "dependency hell" because the library versions in the target distribution don't match the versions in your distribution.

MK
MK
Ivan Ferreira
Honored Contributor

Re: What is the difference between .src and .rpm packages

The .rpm file is the installation package for a program ready to run.

The .src.rpm file is the installation package for the source code of the program. Once installed, it will end on /usr/src/redhat/SOURCES and /usr/src/redhat/SPECS

You may want to install the .src.rpm program if you want to build yourself the program, for example, to enable some functionality not enabled in the distributed .rpm package.

You can re-build an .src.rpm to create an .rpm running:

rpmbuild --rebuild package.src.rpm

This will compile the source and put the .rpm file in /usr/src/redhat/RPMS
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
ben10_1
Regular Advisor

Re: What is the difference between .src and .rpm packages

thanks guys.