You are not logged in.

#1 2014-06-16 16:42:47

mshan
Member
Registered: 2013-05-05
Posts: 105

keep mirrorlist up-to-date and fastest ?

Don't laugh at me if it is child play. I am not expert.
I just wanna share my idea to keep mirrorlist up-to-date and fastest.
It is simple and just need wget

#! /bin/bash


# I create ~/mls dir and go into there
cd /home/msh/mls

# Go to www.archlinux.org/mirrorlist and generate up-to-date mirrorlist from Australia, Japan, Korea and Vietnam using wget
# (I am in Myanmar, they are nearest to me) wget command will generate mirrorlist and save as gml.txt file in my ~/mls dir
wget -O - 'https://www.archlinux.org/mirrorlist/?country=AU&country=JP&country=KR&country=VN&protocol=http&ip_version=4' > /home/msh/mls/gml.txt

# then uncomment all the mirror lines in gml.txt file using sed
sed -i 's/^#Server/Server/' /home/msh/mls/gml.txt

# then rank them and take out five fastest mirrors using rankmirrors
rankmirrors -n 5 /home/msh/mls/gml.txt > /home/msh/mls/rml

# and then backup that rml text file including five fastest mirrors in case of need later
cp rml rml-$(date +%Y%m%d-%I:%M:%S%p)

# at last sent that rml text file including five fastest mirrors to /etc/pacman.d/mirrorlist
echo password | sudo -S cp /home/msh/mls/rml /etc/pacman.d/mirrorlist

# eventually go back to home and sit back
cd /home/msh

I save this script as .genml in my home directory and excute it when I want to update mirrorlist.
It works perfectly.
just sharing my idea, not codes like an expert.

Last edited by mshan (2014-06-16 16:50:51)


Amazing !

Offline

#2 2014-06-16 16:52:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: keep mirrorlist up-to-date and fastest ?

"reflector" in community is a much more general solution.

Offline

#3 2014-06-16 16:56:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: keep mirrorlist up-to-date and fastest ?

Offline

#4 2014-06-16 17:01:14

mshan
Member
Registered: 2013-05-05
Posts: 105

Re: keep mirrorlist up-to-date and fastest ?

yes, I know.
but my idea doesn't need to install any more package other than wget which is already installed as my downloader.
more package is more MB when I run "pacman -Syu".
I stay in the country (Myanmar, Asia) with the slowest internet connection in the world.
I don't want any more package for just a single task.


Amazing !

Offline

#5 2014-06-16 17:09:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: keep mirrorlist up-to-date and fastest ?

Unless you would have install python just for this one package, reflector alone doesn't weight a lot: 14 KB.

Offline

#6 2014-06-16 17:09:54

mshan
Member
Registered: 2013-05-05
Posts: 105

Re: keep mirrorlist up-to-date and fastest ?

just now, I run "pacman -S reflector" and see how many MB do I need to download.
it says 15.38 MB. oh!
So, I cancel installation by pressing "n" and enter.

yes, I don't have paython installed. That's why download size is a little bit big.
I don't want it.
Currently I am using Arch with ratpoison or openbox (sometimes)
They are my favorite WMs because too small and easy.

Last edited by mshan (2014-06-16 17:16:52)


Amazing !

Offline

#7 2016-05-16 14:29:06

msifland
Member
Registered: 2016-03-01
Posts: 12

Re: keep mirrorlist up-to-date and fastest ?

Great script, thanks for making it.

Offline

#8 2016-05-16 14:30:37

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: keep mirrorlist up-to-date and fastest ?

Please don't necrobump, msifland.

https://wiki.archlinux.org/index.php/Fo … bumping.22

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB