Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 20653  / 2 Years ago, fri, december 24, 2021, 5:16:29

We're a distributed team, which is why our VMs use the Ubuntu mirror:// setup. Our /etc/apt/sources.list looks like the following:



deb mirror://mirrors.ubuntu.com/mirrors.txt lucid main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt lucid-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt lucid-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt lucid-security main restricted universe multiverse


This by itself is pretty amazing and very helpful for people who work in different locations — less local customization, etc. necessary. Fail-over in theory.



In day-to-day, this setup fails too often. I want to say 2-3 times this week.



Right now mirrors.ubuntu.com returns ftp.uni-bayreuth.de as my closet mirror. Unfortunately, it seems to be down.



This has been going on for a few hours and the mirror is hosted by volunteers at a university and today being a Friday, my hopes are low that this is getting corrected soon.



All talk, my questions are:




  • Does anyone use this?

  • How do you work around downtime? (my quick-fix is a shell script)

  • How can I help to improve this situation?


More From » apt

 Answers
1

I appreciate all the input on this question, but since no one came up with a simple solution which fit our circumstances, I decided to fix the problem myself.



I created a tool (specifically for Ubuntu) which I call apt-spy2.



The primary objective of this tool is to find a working mirror fast. Working is defined by that the mirror server is available and (hopefully :) up to date.



I make no assumptions about if the selected server is necessarily the closest and the fastest. I'm not doing any pings or GEO DNS tricks — but so far this works when something breaks.



How it works — in a nutshell:




  1. I use http://mirrors.ubuntu.com or launchpad's list of mirrors to retrieve servers.

  2. I do a simple check on each (for HTTP Response Status Code).

  3. LBNL, I update /etc/apt/sources.list.



Please note: This assumes that people play nice and put additional mirrors (e.g. 3rd party repositories into /etc/apt/sources.list.d. But I guess that means there's room for improvement.



You can obtain this tool like so:




$ [sudo] gem install apt-spy2



The cli comes with list, check, fix and help (with extended information on how to use it).



I tried to document as much as possible in the project's README.



The current version is a very conservative 0.5.0.



The code is open source and the license is liberal. And I take all contributions.


[#30343] Friday, December 24, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raldership

Total Points: 222
Total Questions: 115
Total Answers: 124

Location: North Korea
Member since Fri, Nov 4, 2022
2 Years ago
;