Eos-rankmirrors ranks mirrors by default now

Hi all!

Today I changed package eos-rankmirrors to automatically rank the EndeavourOS mirror list (but not the Arch mirror list!) after every update of this package.

If you are OK with the automatic EndeavourOS mirror ranking, then you don’t have to do anything.

But if you have already set up a great /etc/pacman.d/endeavouros-mirrorlist that you don’t want to change, you can keep your own list by configuring variable

EOS_AUTO_MIRROR_RANKING=no   # 'no' to prevent auto ranking

in file

/etc/eos-rankmirrors.conf
8 Likes

Oh no you didn’t!

Ahhhh, so I don’t have to do anything. I like this option :slight_smile:

All joking side, this works fine for me, just updated thank you kindly!

Edit: This is the new default config file for anyone curious btw:

sudo nano /etc/eos-rankmirrors.conf

  GNU nano 6.0                                                                       /etc/eos-rankmirrors.conf                                                                                 
###############################################
# eos-rankmirrors.conf
###############################################

# EOS_AUTO_MIRROR_RANKING determines whether the EndeavourOS mirror list
# will be automatically ranked every time package endeavouros-mirrorlist
# is updated.
# Supported values:
#   yes     rank the mirror list automatically
#   no      do not rank the mirror list automatically
#
EOS_AUTO_MIRROR_RANKING=yes

# EOS_AUTORANK_TIMEOUT specifies the maximum time (in seconds)
# for each mirror to return the full answer.
#
EOS_AUTORANK_TIMEOUT=30
1 Like

Something more: added a timeout variable EOS_AUTORANK_TIMEOUT for those who have problems with timeouts during ranking.
Note that this variable applies only to the automatic ranking, but not manual.

4 Likes

Thanks for testing btw! :sweat_smile:

3 Likes
[ricklinux@eos-kde ~]$ eos-rankmirrors
Fetching the latest available endeavouros-mirrorlist ...
Ranking EndeavourOS mirrors, please wait ...
######################################################
####                                              ####
###        EndeavourOS Repository Mirrorlist       ###
####                                              ####
######################################################
#### Entry in file /etc/pacman.conf:
###     [endeavouros]
###     SigLevel = PackageRequired
###     Include = /etc/pacman.d/endeavouros-mirrorlist
######################################################
### Tip: Use the 'eos-rankimirrors' program to rank
###      these mirrors or re-order them manually.
######################################################

## Germany
#Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
#Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
#Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch

## Sweden
#Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
#Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch

## Canada
#Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch

## China
#Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch

## Singapore
#Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
#Server = http://mirror.jingk.ai/endeavouros/repo/$repo/$arch

## France
#Server = https://endeavour.remi.lu/repo/$repo/$arch


# Results of mirror ranking at (UTC) 2022-01-04 11:16:10 PM:
# The following fields are shown for each mirror:
#   mirror:          The mirror address
#   update-level:    Ordinal number of the latest update (larger is newer)
#   fetch-time:      Measures the speed of the mirror (smaller is faster)
#
# mirror                                                             update-level  fetch-time
# ~~~~~~                                                             ~~~~~~~~~~~~  ~~~~~~~~~~
# https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch       1172          0.260558
# https://de.freedif.org/EndeavourOS/repo/$repo/$arch                1172          0.458717
# https://mirror.moson.org/endeavouros/repo/$repo/$arch              1172          0.478440
# https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch         1172          0.557030
# https://mirror.alpix.eu/endeavouros/repo/$repo/$arch               1172          0.629908
# http://mirror.jingk.ai/endeavouros/repo/$repo/$arch                1172          0.689427
# https://mirror.jingk.ai/endeavouros/repo/$repo/$arch               1172          0.710676
# https://endeavour.remi.lu/repo/$repo/$arch                         1172          0.713251
# https://mirror.linux.pizza/endeavouros/repo/$repo/$arch            1172          0.785747
# https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch  1169          1.496390

# EndeavourOS mirrorlist:
Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch
Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch
Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
Server = http://mirror.jingk.ai/endeavouros/repo/$repo/$arch
Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
Server = https://endeavour.remi.lu/repo/$repo/$arch
Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch

Moving old mirrorlist to /etc/pacman.d/endeavouros-mirrorlist.2022.01.04-18.16.10.
Writing new mirrorlist to /etc/pacman.d/endeavouros-mirrorlist.
Root Password: 

[ricklinux@eos-kde ~]$ 
1 Like

I may have asked this once before I can’t quite remember, but are there any thoughts to getting a US server added for the EndeavourOS repos or is the Canada server sufficient enough?

You could use @westandskif’s great utility rate-mirrors with the stdin option to rate EndeavourOS mirrors. Perhaps he could be persuaded to include them by default into his utility?

1 Like

I think we would love some more mirrors but that requires a mirror operator to volunteer their storage and bandwidth.

2 Likes

Have you managed to make it work? The documentation is not clear to me.

What are the criteria for ranking EOS mirror lists?

I think I looked into it and you need a legit server setup if I remember. It’s not like a raspberry pi in a garage

So you said every time the eos-rankmirrors is updated, or did you mean, every time we update at all.

Will my normal pacman -Syu update?

Does this create a a pacnew file?

Try this:

cat << EOF | rate-mirrors stdin --path-to-test="endeavouros/x86_64/endeavouros.files" --path-to-return='$repo/$arch' | sed 's/^[^#]/Server = h/g'
https://mirror.alpix.eu/endeavouros/repo/	DE
https://de.freedif.org/EndeavourOS/repo/	DE
https://mirror.moson.org/endeavouros/repo/	DE
https://ftp.acc.umu.se/mirror/endeavouros/repo/	SE
https://mirror.linux.pizza/endeavouros/repo/	SE
https://ca.gate.endeavouros.com/endeavouros/	CA
https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/	CN
https://mirror.jingk.ai/endeavouros/repo/	SG
http://mirror.jingk.ai/endeavouros/repo/	SG
https://endeavour.remi.lu/repo/	FR
EOF

It works fine, the only problem I did not know how to fix was the output missing "Server = " before the URL, hence that somewhat ugly sed hack at the end.

This outputs the result to stdout, if you want it written to mirrorlist file, just add

 | sudo tee /etc/pacman.d/endeavouros-mirrorlist

to the end of the first line (make a backup first, of course).

2 Likes

By default: first age of mirrors, then speed.
I might add a configuration for this too if needed.

@fbodymechanic

Thanks for pointing out my unclear wording!

It should have been: automatic ranking takes place always when package
endeavouros-mirrorlist is updated.

So only when that particular package is updated (and also initially installed).

Does this create a a pacnew file?

No, instead it creates a backup of the file that existed before the update. So you are able to revert to your previous EndeavourOS mirrorlist.

@Kresimir
Thanks! I’ll try that soon.
EDIT: works a treat! I had almost similar example here, but for some reason it failed. Probably some minor syntax problem… :upside_down_face:

2 Likes

@manuel

I notice that eos-rankmirrors saves backups in /etc/pacman.d/ with filenames like endeavouros-mirrorlist.2022.01.05-05.52.

How many versions will be saved?
Is this number configurable?

Does it matter? Each of these backups is about 1 KiB in size. It’s extremely unlikely you’ll ever run out of storage space that way, but you are free to delete them manually if they build up and start to clutter the directory.

However, ranking the EndeavourOS mirrors is something you should probably do once, if at all. It’s not a very busy repo and most packages in it are tiny and seldom updated, so it’s not like the package download speed matters with it. :wink:

1 Like

Thanks for your reply - I was just curious.

Thanks, so everything is clean. :slight_smile:

1 Like

Hello, thank you for using the tool and letting people know about it! glad it helps sometimes :slight_smile:

I believe I should add --output-prefix to complement --comment-prefix option.
So that --output-prefix="Server = " could replace sed

1 Like

Yes, that would be a very useful addition.

And also, if it is not too much to ask, could you please implement

rate-mirrors endeavouros

only for the endeavouros mirrorlist (this should not rank Arch mirrors), so that no stdin is necessary for this particular case? :slight_smile:

1 Like

Isn’t the backup kicking in too late with that?

From what I see the backup of the current list is being made with eos-rankmirrors which is triggered after endeavouros-mirrorlist is upgraded (so at that point /etc/pacman.d/endeavouros-mirrorlist has already been replaced :thinking: )