Alternatively, you can do the following:
A: Enable the source repositories. To do this, add 'deb-src' lines to your /etc/apt/sources.list for each repository you're interested in. E.g. if you have the following line in sources.list:
You'd need to add the following line to get code from that repository.
deb http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
Third-party (non Ubuntu) repositories may not provide source code.
deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
B: Update your package descriptions:
(Note that (A) and (B) can probably be done from within Synaptic etc.)
sudo apt-get update
C: Get the source code for the package you're interested in. You should not run the following command as root (sudo). The code will be downloaded to the current directory
If you plan on compiling something obtained from the repositories, you should run 'apt-get build-dep' to obtain the dependencies for the package. Before compiling anything, you'll also need the 'build-essential' package, which brings in the GNU compiling tools such as gcc and make.
mkdir -p ~/src/amarok
apt-get source amarok
sudo apt-get install build-essential
sudo apt-get build-dep amarok