Possible Duplicate:
How do I get the source code of packages installed through apt-get?

I want to look over some programs to help me learn programming, so I enabled the source repository in Ubuntu. How do I download things from that repository?

marked as duplicate by fossfreedom, psusi, Jorge Castro, Takkat, htorque Feb 3 '12 at 20:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • ... actually - I think your question is actually a duplicate... – fossfreedom Jan 30 '12 at 18:38

First - create a working folder to download the source in

mkdir ~/working_dir
cd ~/working_dir

The simplest way is to use the syntax apt-get source [foo] where [foo] is the package name.

For example - if you wanted to see the source of nautilus you would use

apt-get source nautilus

basic development tools

Obviously - if you are intent on playing with code changes you need a few extras.

sudo apt-get install devscripts build-essential fakeroot

building packages

To get install the development packages and dependencies use the syntax

sudo apt-get build-dep [foo]

Finally - to build the debian package

debuild -us -uc
  • This will download all the files to the current directory. Make sure you run it from where you want the files. – Zoke Jan 30 '12 at 18:28
  • ... good comment - have updated. thanks. – fossfreedom Jan 30 '12 at 18:33

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