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.

1
  • 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, 2014 at 9:21

1 Answer 1

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.

2
  • 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, 2014 at 9: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, 2014 at 9:49

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.