volitank / nala

Nala is a front-end for libapt-pkg.
GNU General Public License v3.0
1.44k stars 47 forks source link

Add preferred mirrors list option #11

Closed rizajur closed 8 months ago

rizajur commented 1 year ago

Add preferred mirrors list option please.

I have 2 server which have 20GB/s bandwidth in my region and i would like to set them.

volitank commented 1 year ago

What exactly is the request? What would you see a preferred mirrors list option look like, and what would it do?

rizajur commented 1 year ago

a preferred mirrors list option would look like an config options where i can list multiple mirrors preferably with good speed (not only ping)

currently it seems like just one server is being used, which is listed in /etc/apt/sources.list for each repository When i state 2 server for the same repo in /etc/apt/sources.list i dont know if it would fallback to the other one is case the first is offline. Some kind of fail safe, setting a fallback option would be need. Okay i tried to add 2 and break the first mirror, i could get either

bullseye-backports main non-free contrib bullseye-backports main non-free contrib

Error: https://1mirrors.blabla.org/debian bullseye-backports InRelease Could not resolve '1mirrors.blabla.org'

or i get (in case the webserver is broken / moved the directories or something)

Error: The repository 'https://mirrors.blabla.org/debian1 bullseye-backports Release' does not have a Release file.

nala states it has "Ignored" these repos and does fall back to the second repo, but still i get these errors and cant proceed with my updates.

i checked out the donate section, sadly i cant support through librepay but if you leave me a crypto address i will leave you a tip regardless of this issue (i didnt want to create a seperate issue for that since some people are somewhat toxic against freedom money)

volitank commented 1 year ago

Apt actually handles the mirrors and updating. That is entirely passed to libapt-pkg. Nala has a command called fetch that will get all the mirrors for your distro, test latency and download speed and choose the best ones accordingly. You have the final say in which mirrors to choose of course.

This can be accomplished by simply using nala fetch

When updating, if you have a bad mirror it's still going to fail. It should be able to update the others. In the case of doing nala upgrade it will first update the package lists and then upgrade. If the update fails due to bad mirrors or whatever, it will still continue to upgrade with what is available.