Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find that this would be very useful in certain situations in which I want to install software in a different way, or change flags, or not let the software manager know the program has been installed (so it wouldn't look for updates). I know packages can be built from source codes, and this is relatively common, but I don't know about the other way around. It would also be useful for converting one type of package into another when Alien doesn't work or doesn't provide good results. I've been searching on-line but there seems to be no or few records of source code extraction from pre-built packages...

share|improve this question
up vote 5 down vote accepted

Debian and RPM packages don't contain source code, only the compiled result. However, you can fetch the source packages - SRPMS, or the Debian description, patch, and original tarball.

Those can be recompiled with whatever local modifications you want, and will more or less do what you want - though remember to adjust the version number to make it clear that your version is "later" than the distribution version.

share|improve this answer
    
So, there is no way to convert a package I already have into source code? – the_midget_17 Feb 12 '12 at 5:29
    
Not directly; both apt and yum offer tools to download the source package by name, but you can't extract what isn't present from the binary files. – Daniel Pittman Feb 12 '12 at 5:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .