Wednesday, July 20, 2016

16.04 - Can I consolidate lines in /etc/apt/sources.list


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?



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


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...