5

I'm using Ubuntu desktop (Linux version 3.11.0-15-generic (buildd@allspice)). I tried to get linux source code by command:

sudo apt-get source linux-image-3.11.0-15-generic

Then I saw this error:

home@ubuntu:~$ sudo apt-get source linux-image-3.11.0-15-generic

Reading package lists... Done

Building dependency tree       

Reading state information... Done

E: You must put some 'source' URIs in your sources.list

I can't find the suitable URI link to add in /etc/apt/sources.list.

Alvar
  • 17,058
user259731
  • 53
  • 1
  • 3
  • I have Kubuntu, not vanilla Ubuntu, so I don't know how to do this via GUI, but some entries in /etc/apt/sources.list have an additional "source" entry. e.g. deb http://extras.ubuntu.com/ubuntu saucy main is on one line, followed by deb-src http://extras.ubuntu.com/ubuntu saucy main. I think the latter is required to download sources. – Sparhawk Mar 19 '14 at 09:21

1 Answers1

4

Use

sudo software-properties-gtk

Software sources

Enable "Source code" checkbox on tab "Ubuntu Software". Then run

sudo apt-get update

to get sources lists.

Danatela
  • 13,243
  • 11
  • 45
  • 72
  • Thanks Danatela. I did as your instruction and it could download linux source code. But instead of downloading linux-image-3.11.0-15-generic, it downloaded linux 3.2.0-60.91. – user259731 Mar 19 '14 at 09:47
  • home@ubuntu:/tmp$ sudo apt-get source linux-image-3.11.0-15-generic Reading package lists... Done Building dependency tree
    Reading state information... Done Picking 'linux' as source package instead of 'linux-image-3.11.0-15-generic'
    – user259731 Mar 19 '14 at 09:49