Ubuntu – consolidate lines in /etc/apt/sources.list

16.04aptsoftware-sourcesupdates

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?

Best Answer

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 :))