# Eos-rankmirrors ranks mirrors by default now

**URL:** <https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241>\
**Category:** Announcements and news\
**Created:** [January 4, 2022, 9:53pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241 "2022-01-04T21:53:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [January 4, 2022, 9:53pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/1 "2022-01-04T21:53:32Z")

</div>

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

```auto
EOS_AUTO_MIRROR_RANKING=no # 'no' to prevent auto ranking

```

in file

```auto
/etc/eos-rankmirrors.conf

```

---

<div class="post-metadata">

**Author:** ![Scotty\_Trees](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/scotty_trees/32/29792_2.png) [@Scotty\_Trees](https://forum.endeavouros.com/u/Scotty_Trees)\
**Post date:** [January 4, 2022, 10:04pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/2 "2022-01-04T22:04:57Z")

</div>

> [@manuel](#):
>
> Today I changed package `eos-rankmirrors`

Oh no you didn’t!

> [@manuel](#):
>
> If you are OK with the automatic EndeavourOS mirror ranking, then you don’t have to do anything.

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

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`

```auto
  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

```

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [January 4, 2022, 10:19pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/3 "2022-01-04T22:19:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [January 4, 2022, 10:21pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/4 "2022-01-04T22:21:06Z")

</div>

Thanks for testing btw! 😅

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [January 4, 2022, 11:17pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/5 "2022-01-04T23:17:16Z")

</div>

```auto
[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 ~]$ 

```

---

<div class="post-metadata">

**Author:** ![Scotty\_Trees](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/scotty_trees/32/29792_2.png) [@Scotty\_Trees](https://forum.endeavouros.com/u/Scotty_Trees)\
**Post date:** [January 4, 2022, 11:41pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/6 "2022-01-04T23:41:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kresimir](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kresimir/32/73739_2.png) [@Kresimir](https://forum.endeavouros.com/u/Kresimir)\
**Post date:** [January 5, 2022, 2:59am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/7 "2022-01-05T02:59:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [January 5, 2022, 3:02am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/8 "2022-01-05T03:02:56Z")

</div>

> [@Scotty\_Trees](#):
>
> are there any thoughts to getting a US server added for the EndeavourOS repos or is the Canada server sufficient enough?

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

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [January 5, 2022, 10:05am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/9 "2022-01-05T10:05:38Z")

</div>

> [@Kresimir](#):
>
> `rate-mirrors` with the `stdin`

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

---

<div class="post-metadata">

**Author:** ![zoli62](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/z/4bbf92/32.png) [@zoli62](https://forum.endeavouros.com/u/zoli62)\
**Post date:** [January 5, 2022, 10:10am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/10 "2022-01-05T10:10:54Z")

</div>

What are the criteria for ranking EOS mirror lists?

---

<div class="post-metadata">

**Author:** ![anon63071375](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@anon63071375](https://forum.endeavouros.com/u/anon63071375)\
**Post date:** [January 5, 2022, 10:14am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/11 "2022-01-05T10:14:36Z")

</div>

> [@dalto](#):
>
> think we would love some more mirrors but that requires a mirror operator to volunteer their storage and bandwidth

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

> [@manuel](#):
>
> 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.

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?

---

<div class="post-metadata">

**Author:** ![Kresimir](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kresimir/32/73739_2.png) [@Kresimir](https://forum.endeavouros.com/u/Kresimir)\
**Post date:** [January 5, 2022, 10:29am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/12 "2022-01-05T10:29:09Z")

</div>

Try this:

```auto
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

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

```

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

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [January 5, 2022, 10:41am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/13 "2022-01-05T10:41:49Z")

</div>

> [@zoli62](#):
>
> What are the criteria for ranking EOS mirror lists?

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

@anon63071375

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… 🙃

---

<div class="post-metadata">

**Author:** ![kjw](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kjw/32/9327_2.png) [@kjw](https://forum.endeavouros.com/u/kjw)\
**Post date:** [January 5, 2022, 11:54am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/14 "2022-01-05T11:54:15Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![Kresimir](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kresimir/32/73739_2.png) [@Kresimir](https://forum.endeavouros.com/u/Kresimir)\
**Post date:** [January 5, 2022, 11:58am UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/15 "2022-01-05T11:58:46Z")

</div>

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. 😉

---

<div class="post-metadata">

**Author:** ![kjw](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kjw/32/9327_2.png) [@kjw](https://forum.endeavouros.com/u/kjw)\
**Post date:** [January 5, 2022, 12:01pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/16 "2022-01-05T12:01:40Z")

</div>

Thanks for your reply - I was just curious.

---

<div class="post-metadata">

**Author:** ![zoli62](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/z/4bbf92/32.png) [@zoli62](https://forum.endeavouros.com/u/zoli62)\
**Post date:** [January 5, 2022, 12:30pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/17 "2022-01-05T12:30:58Z")

</div>

> [@manuel](#):
>
> By default: first _age_ of mirrors, then _speed_.  
> I might add a configuration for this too if needed.

Thanks, so everything is clean. 🙂

---

<div class="post-metadata">

**Author:** ![westandskif](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/w/dec6dc/32.png) [@westandskif](https://forum.endeavouros.com/u/westandskif)\
**Post date:** [January 5, 2022, 5:48pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/18 "2022-01-05T17:48:31Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Kresimir](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kresimir/32/73739_2.png) [@Kresimir](https://forum.endeavouros.com/u/Kresimir)\
**Post date:** [January 5, 2022, 6:06pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/19 "2022-01-05T18:06:24Z")

</div>

Yes, that would be a very useful addition.

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

```auto
rate-mirrors endeavouros

```

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

---

<div class="post-metadata">

**Author:** ![moson](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/moson/32/78325_2.png) [@moson](https://forum.endeavouros.com/u/moson)\
**Post date:** [January 5, 2022, 6:08pm UTC](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241/20 "2022-01-05T18:08:48Z")

</div>

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

[Next page](https://forum.endeavouros.com/t/eos-rankmirrors-ranks-mirrors-by-default-now/22241.md?page=2)
