[QUOTE=james147;321416]this is why you should not answer questions at 5AM because you cannot sleep
lol for some reason that's the time I tend to crack the last piece of some code for something!
Thanks for the tip!
I seem to have a small problem with the end result because of a modification to my sources.list just prior to executing this. Right before runnign the fastest mirror hack, as I call it, I need to add the backports repo to the sources.list, so I do:
then I run netselect and when it is done, I end up with a bad /etc/apt/sources.list like this:
It seems that no matter what there is always an empty line on the end of /etc/apt/sources.list so when netselect is done, it tried to place a URL on that empty line. I assumed I could use sed or awk to strip the blank line prior to netselect. I can, but the result is still the same once netselect is done.
lol for some reason that's the time I tend to crack the last piece of some code for something!
There was no real reason for using multiple lines except it makes it easier to read and debug. You can combine the pipes into one expression or split them out into more if you wanted. But at the time I figured that those steps would be handy to see if something went wrong. It makes no difference to the end result however. It is slightly less efficient splitting it up, but for this situation it is not going to make any noticeable difference (only if you are handling thousands of mirrors would you even start to be able to measure the overhead).
Overall when you do not need high performance it is better to go with the more readable solution to make maintenance easier and you should never optimize before you have a working solution
Overall when you do not need high performance it is better to go with the more readable solution to make maintenance easier and you should never optimize before you have a working solution
I seem to have a small problem with the end result because of a modification to my sources.list just prior to executing this. Right before runnign the fastest mirror hack, as I call it, I need to add the backports repo to the sources.list, so I do:
Code:
cp -vv /etc/apt/sources.list /etc/apt/sources.list.bak sed -i 's/universe/universe multiverse/g' /etc/apt/sources.list echo 'deb http://archive.ubuntu.com/ubuntu lucid-backports main restricted universe' >> /etc/apt/sources.list
Code:
deb http://mirror.netcologne.de/ubuntu/ lucid main restricted universe multiverse deb http://mirror.netcologne.de/ubuntu/ lucid-updates main restricted universe multiverse deb http://mirror.netcologne.de/ubuntu/ lucid-security main restricted universe multiverse http://mirror.netcologne.de/ubuntu/ deb http://mirror.netcologne.de/ubuntu/ lucid-backports main restricted universe multiverse
Comment