35

It takes a long time to update my software sources when I run:

sudo apt-get update

I believe that happens when the apt-get is downloading source code from the repository, in my case it the one in Ethiopia. It really slows down when it hits something similar to:

http://et.archive.ubuntu.org ....

I checked where I added that source and it was under the source code option. Do I need the source code to be downloaded? If not, can I un-check that option with out any consequences?

3
  • BTw, where is the source code stored? So that I can have a look?
    – balki
    Aug 9, 2012 at 18:08
  • You will only need source repositories if you want to install software that needs to be compiled. Applications like this are usually in tarballs (app-name.tar.gz). Once in awhile, just part of an application needs to be compiled - usually something related to drivers or modules. Unless you want the very latest version of some software that hasn't been packaged or released for your system yet or an uncommon application, you probably won't run into this.
    – Joe
    Aug 9, 2012 at 19:58
  • @balki, according to this link, lists.ubuntu.com/archives/ubuntu-users/2006-September/…, if you want to see the source code of a package, all you need to do is, sudo apt-get source <package>. Hope this helps.
    – tsega
    Aug 12, 2012 at 13:51

3 Answers 3

29

Unless you are planning to modify the software yourself then you can safely disable it. Most users will never need the source code.

You can shut it off by launching the Software Center, then going to Edit -> Software Sources in the menu, and then disabling the "Source Code" check box:

enter image description here

It will then prompt you for your password and then rerun an update.

1
  • Thanks @JorgeCastro, I've done that and also used the answer below to choose the best server automatically. Pleased to say it's working much faster now.
    – tsega
    Aug 6, 2012 at 14:19
14

This does not specifically address the question about whether or not you need to have source code repositories enabled. But you may find it useful, as it directly addresses the most common cause of the slowdown you're having. I copied this from my answer here.

You can have the update manager select the best main repos to use automatically, which will result in the best download speeds. To do that, open Update Manager, then click Settings. Select the Ubuntu Software tab, then in the "Download from:" dropdown, select Other...

Update Manager - Ubuntu Software Tab

Now, in the window that pops up, click "Select Best Server"

Update Manager - Choose a Download Server

It will then perform several tests to select the best server for you. Once it is completed, just click Choose Server.

Update Manager - Choose a Download Server

Now, just run your updates again and you should notice an improvement (if your best available repo wasn't already selected).

4
  • Thanks @reverendj1, it was the exact thing I needed. I just tired it and it worked much faster now.
    – tsega
    Aug 6, 2012 at 14:16
  • You're welcome. I'm just trying to help spread the Ubuntu love. :-)
    – reverendj1
    Aug 6, 2012 at 14:17
  • Why is the "source code" option a dash, not a check? I can't get mine to be a check....
    – nealmcb
    Jan 13, 2015 at 20:03
  • I believe it is because you have repos setup that do not provide source code (i.e. a deb-src line), so it shows a dash, meaning that it will only download source for some repos.
    – reverendj1
    Jan 14, 2015 at 21:00
0

You can safely disable source code, if you don't need to get build depedencies with "apt-get build-dep" nor changelogs nor the source code itself from Ubuntu repositories.

1
  • Why the downvote. This is the deepest answer. May 10, 2020 at 12:23

You must log in to answer this question.

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