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?

Braiam
  • 67,791
  • 32
  • 179
  • 269
tsega
  • 776
  • BTw, where is the source code stored? So that I can have a look? – balki Aug 09 '12 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 09 '12 at 19:58
  • @balki, according to this link, https://lists.ubuntu.com/archives/ubuntu-users/2006-September/093833.html, if you want to see the source code of a package, all you need to do is, sudo apt-get source . Hope this helps. – tsega Aug 12 '12 at 13:51

3 Answers3

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.

Jorge Castro
  • 71,754
  • 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 06 '12 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).

reverendj1
  • 16,045
  • Thanks @reverendj1, it was the exact thing I needed. I just tired it and it worked much faster now. – tsega Aug 06 '12 at 14:16
  • You're welcome. I'm just trying to help spread the Ubuntu love. :-) – reverendj1 Aug 06 '12 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 '15 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 '15 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.

Aminda
  • 327