In Debian, AFAIK some packages are maintained in Subversion (famously team-pkg-gnome), while some are maintained in git, and others in some other VCS.

Is there a way to know where the source of a package is without doing an apt-get source $PACKAGENAME?

I tried three methods and all failed :-

$apt show $PACKAGENAME
$aptitude show $PACKAGENAME 
$apt-cache show $PACKAGENAME 

none of the above are able to give/share this information.

Is there anyway to get the information. I need to know the source repo. name and whether it is in git, svn or some other version control.


Using CLI tools

As indicated by derobert, Debian packages which are maintained in a VCS are supposed to indicate this in a pair of Vcs-... fields in their source package.

The best tool to use this information is debcheckout in the devscripts package, or apt-cache showsrc. Both of these will show you gnome-disk-utility's repository information.

apt-get showsrc gnome-disk-utility

will show all the information contained in the source package, including links to the VCS (Vcs-Brower gives a link for use in a brower, Vcs-Git give the link to clone the git repository, assuming the repository uses git):

Vcs-Browser: https://anonscm.debian.org/cgit/pkg-utopia/gnome-disk-utility.git
Vcs-Git: git://anonscm.debian.org/pkg-utopia/gnome-disk-utility.git


debcheckout -d gnome-disk-utility

will only show the VCS information and pertinent details (if the package is hosted in a VCS).


If you then want to check the source out,

debcheckout gnome-disk-utility

will do that for you.

Web Interface

You can also see this information on the Debian Package Tracker, which will link to the VCS where the package is hosted (if there is one).


A lot of package include this in their control information in the Vcs-* fields. You can see it easily (and without downloading the source package) using apt-cache showsrc.

$ apt-cache showsrc gnome-disk-utility
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-utopia/gnome-disk-utility.git
Vcs-Git: git://anonscm.debian.org/pkg-utopia/gnome-disk-utility.git

So in this case, you could do a git clone git://anonscm.debian.org/pkg-utopia/gnome-disk-utility.git to download the source, or browse it on the web at https://anonscm.debian.org/cgit/pkg-utopia/gnome-disk-utility.git.

Not all packages have Vcs-* fields. They can be missing because the maintainer doesn't use a VCS (or at least not a public one), or hasn't added the headers for some other reason. apt-get source packagename will always get the source, though not via a VCS. Similarly, you can browse all the source online at http://sources.debian.net/

(Note: you will need deb-src lines in your sources.list file.)

Update: Stephen Kitt points out debcheckout -d; first time I'd heard of it too. See (and upvote) Stephen Kitt's answer for details.


You are not entirely right: the Debian source code is in source packages: you need some lines with deb-src in your /etc/apt/sources.list like e.g.

 deb-src http://ftp2.fr.debian.org/debian/ jessie main contrib non-free

(adapt that to your geography and habits)

Then you can ask that source code to be built from source using e.g. aptitude build (and you might want to use aptitude build-dep to install the packages needed for that build).

The Debian maintainers are packaging the source code by incorporating their patches relative to some upstream software repository. That upstream software repository uses (or perhaps not) the version control system they want to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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