I'm looking to apt-get the source code of packages in WSL.

$ apt-get source bash
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list

These are the default sources that came with the installation:

deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse

Where do they reside and how should I go on adding them?

  • Just to confirm, you can, in fact, add normal Debian repositories to WSL and get a measure of success installing binaries. I wasn't so sure, but it worked for getting kubectl via deb http://apt.kubernetes.io/ kubernetes-xenial main as described at devops.buzz/kubernetes-install-kubectl-on-ubuntu/… I'm really starting to enjoy switching for Apple's failing hardware [standards] to Windows. Nov 15, 2018 at 20:00

4 Answers 4


As no one has adequately answered this question and I came here looking for the answer but found it out myself, I figured I'll add it so that others may benefit.

On WSL Ubuntu 16.04 (xenial), the sources reside in /etc/apt/sources.list You may edit that directly in your favorite editor and then run sudo apt update to see changes. Note that the sources are included as comments by default, so simply uncommenting them by deleting the # (and adding additional repositories if desired) can be done very simply.


If for some reason your sources.list file is corrupted and/or simply does not have them, you can download the current version of the original source image from https://cloud-images.ubuntu.com/xenial/current, then find and download the xenial-server-cloudimg-amd64-wsl.rootfs.tar.gz file (note the amd64 and wsl parts of the filename). Inside that archive you can find the original file at etc/apt/sources.list, which you can use to replace or take from to supplement your current file.

Other newer versions of WSL Ubuntu can also be found at the main https://cloud-images.ubuntu.com/ address.


The solution is to add this line :

deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse

Just in case you came to this question for the same reason I did:

I had just installed/activated WSL, and I wanted to open Midnight Commander. I typed mc and there was no mc. So I did what the system recommended and did apt install mc and the system said it had never heard of mc.

I checked /etc/apt/sources.list as Shenk advises, and I found plenty of sources! No need to go hunting. All that was missing was

apt update .

After that, I could install every software known to Ubuntu.


FYI, in 2021, the below is not valid anymore.

deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse

Use apt-add-repository instead:

apt-add-repository http://archive.ubuntu.com/ubuntu/

You must log in to answer this question.

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