Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I want to get the source code for a project and then build it the same way that apt would. E.g. I want the working source code and be able to run 'make' or similar command on the source.

How can I do that?

Specifically I want to get this source 'icedtea-6-jre-jamvm'

share|improve this question

2 Answers 2

up vote 6 down vote accepted

For this example I'll use icedtea-6-jre-jamvm as the package you want to rebuild.

First install all the dependencies and build essential:

sudo apt-get build-dep icedtea-6-jre-jamvm
sudo apt-get install build-essential

Then grab the source:

apt-get source icedtea-6-jre-jamvm

Then cd in the openjdk directory directory and build the deb, the -us and -uc here skip the GPG checks if you're just rebuilding it for yourself:

cd openjdk-6-6b24-1.11.5
dpkg-buildpackage -us -uc

Then go up a directory and you should have .deb files.


share|improve this answer
that is very nice! one big hurdle to start contributing to a free software program is "getting it to compile", and it is nice to see this automated. It would be neat, however, if we could generate the binaries and stop there (i.e. not generate the debs) since this is a bit more convenient for developers who are editing and compiling frequently... Do you happen to know a way to do that? – josinalvo Jun 18 at 20:03

You can use the follwing :

apt-get source <package>

you need to make sure you install the build dependencies :

sudo apt-get build-dep <package> 

for more info run :

man apt-get

Alternative option :First you need to know the location of the package. then download the tar file using :

sudo wget <url>

You can then untar it and compile it using make

if your not sure about the specific command look inside of the folder, there should be a README file or INSTALL which will tell you the appropriate command .

share|improve this answer
That is get from the host site. Is there a way to do it with 'apt. Completely through 'apt' minus the actual compile. E.g. can I do 'apt get source' and then navigate to that directory and then 'make'. – Berlin Brown Jan 23 '13 at 17:19
sorry, just updated the question! – meda Jan 23 '13 at 17:28

Your Answer


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.