8

I am guessing -- but would like to confirm -- that, in the /etc/apt/sources.list file, there is no reason why one cannot replace these three lines:

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security restricted main

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security universe

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security multiverse

with this one line:

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security main restricted universe multiverse

Is this (as long as the lines have the same repository-URL and distribution type) correct? Or is there some purpose to having them as separate lines with the component-type spread among the different lines?

3 Answers 3

6

Your assumption is right - as is your example. Consolidation can be done and sources are often defined that way.

So far, the only reason that crossed my mind for splitting them up is that universe and multiverse are pretty big repos that take time to update and influcence the size of the resulting database - and thus the risk something breaks. If you have single lines they are easy to comment out :))

One might think that is does not make a big difference. But once you start automating an infrastructure the automation tools tend to do apt-get update a lot and it makes sense to reduce that time if the packages involved are not needed.

But apart from that I can only think of better documentation targeting in the original sources.list file :))

1
  • Thanks, everyone, all are really good answers. I hadn't thought about the size of the repos playing a part. But to me the mostly-duplicated lines are a waste of space, & I prefer having all the repos listed on one line, others may prefer another way & it's great the flexibility for such is there. Sep 15, 2016 at 17:59
6

Debian has a nice page that confirms your idea:

Thus the syntax of:

Archive type --> Repository URL --> Distribution --> Component --> Component --> Component

Represents your suggested line of:

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security main restricted universe multiverse

and should be perfectly ok.

Explanatory notes:

  1. Archive type: Normally deb or deb-src, in your case deb
  2. Repository URL: The address of the repository
  3. Distribution: The class of release, in your case 'xenial-security'
  4. Component: restricted, main, universe, multiverse which can be presented, as you have suggested, one after the other separated by a space

References:

6

Yes. You can. You can use

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security restricted main universe multiverse

for a given archive or suite-type like xenial-security, xenial-updates or xenial Instead of having 4 lines.

So the above line is same as having these 4 lines

deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security restricted     
deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security main 
deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security universe     
deb http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ xenial-security multiverse

But I'd advice to split the lines into 4. This helps in quickly locating and editing lines from command line.

You must log in to answer this question.

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