Recently I set up Ubuntu 16.04, and one of the first things I wanted to do was install the software Subsurface. I used the following commands:

$ sudo add-apt-repository ppa:subsurface/subsurface 
$ sudo apt-get update 
$ sudo apt-get install subsurface 

This installed the program, and I'm able to use it.

However, I now need to go to the source tree directory to build a related piece of software, and I gather this is usually called something like /src/subsurface somewhere on the system. However, I'm not finding it -- it's not under /usr/src or /usr/local/src, and the find command doesn't turn up anything promising.

I've emailed the Subsurface developers, but in the meantime: Is there a usual place where source files live following a package installation? Is there anything that usually needs to be toggled to preserve the source files? I'm pretty much a newbie to working with packages.

  • Looks like you have installed a binary package, not a source package. Remember to enable deb-src in your sources.list. Then try sudo apt-get source subsurface to install the source package.
    – user535733
    Jun 5, 2017 at 17:48
  • Thanks much. As mentioned I'm new to working with packages -- can you suggest exactly what syntax is required to enable deb-rc in sources.list?
    – Frank O
    Jun 5, 2017 at 20:25

1 Answer 1


From man apt-add-repository, to enable a PPA's source packages you can add the -s option to your command:

-s,  --enable-source  Allow downloading of the source packages from the repository

so it would become

sudo add-apt-repository -s ppa:subsurface/subsurface  

You should then be able to download the source into the current directory in the usual way, i.e. using

sudo apt-get update
apt-get source subsurface

(or just `apt source subsurface) on newer systems).

Alternatively, find the PPA source.list file (usually in /etc/apt/sources.list.d) and add corresponding the deb-src line manually.

  • Thanks. The first command seemed to execute normally. When I ran the second (apt-get source subsurface), it returned the error "E: You must put some 'source' URIs in your sources.list." I see there is a file sources.list in /etc/apt, and also there's directory /etc/apt/sources.list.d that contains a couple of files related to subsurface. Any suggestions on what syntax is required to make the edit it's looking for?
    – Frank O
    Jun 5, 2017 at 20:34
  • @FrankO you should find that the original /etc/apt/sources.list.d/subsurface-ubuntu-subsurface-xxx.list file (which likely has a commented-out deb-src line) gets renamed with a .save suffix, and a new file is created in which the deb-src line is uncommented. Did you remember to run sudo apt-get update again? Jun 5, 2017 at 20:45
  • thanks much. I guess I must have omitted "sudo apt-get update," because when I ran it now the line "apt-get source subsurface" appeared to run normally. It just created a directory "subsurface-4.6.4" off my home directory, but I suppose I can create a /src directory and move it there. Thanks again.
    – Frank O
    Jun 5, 2017 at 21:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .