Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Is there any way (dpkg, apt?) to get a package's sources and URL to repository, if available, in Debian ?

share|improve this question

5 Answers 5

up vote 2 down vote accepted

What about sudo apt-get source packageName? It installs the newest available source tree, when available, in the current working directory.

Check man apt-get for more details.

share|improve this answer
I need just the name. Is there a way to get it ? Also, how could I get the git repo URL from where it downloads the package ? –  Marius Cotofana Jan 16 '13 at 19:47
No real need for sudo here, right? –  sr_ Jan 16 '13 at 21:15

apt-cache policy package displays which versions can be installed from which repositories.

bash$ apt-cache policy dpkg
  Version table:
 *** 0
        500 precise-updates/main amd64 Packages
        500 precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status 0
        500 precise/main amd64 Packages
share|improve this answer

To get the source:
Check that you have a deb-src line in /etc/apt/sources.list.
As root, run apt-get build-dep package.
As normal user, run apt-get source package.

To get the URL, go to Then you get a list of the different versions in the supported archives.
If the source package name differs from the binary, it's in the package description, 2nd line it seems.
grep -A1 binpackagename /var/lib/apt/*Packages |grep Source should do the trick.

share|improve this answer
apt-get install --no-download --reinstall --print-uris package-name
share|improve this answer

You can use website where you can search for packages. It will give you package and repository path as well.

share|improve this answer

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.