You are not logged in.

#1 2007-04-12 15:46:38

rbrownclown
Member
Registered: 2006-12-29
Posts: 125

Rank Mirrors

I heard that rankmirrors is included in pacman 3.  Has pacman been updated to this version in Arch 64?  How do I use it?

Offline

#2 2007-04-12 17:09:14

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

I think pacman 3 is still in testing... You can check your version with pacman -V.

Offline

#3 2007-04-12 19:11:37

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: Rank Mirrors

Yes, pacman3 is still in testing. However, you can get the rankmirror script here:
http://cvs.archlinux.org/cgi-bin/viewcv … oot=Pacman

Offline

#4 2007-04-12 21:17:13

rbrownclown
Member
Registered: 2006-12-29
Posts: 125

Re: Rank Mirrors

Snowman wrote:

Yes, pacman3 is still in testing. However, you can get the rankmirror script here:
http://cvs.archlinux.org/cgi-bin/viewcv … oot=Pacman

Cool... but how do I use it?  Is it as simple as downloading and ./ ?

Offline

#5 2007-04-12 21:24:28

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

Save it in a file like eg. rankMirrors.py and run python ranMirrors.py /etc/pacman.d/current to rank the servers in the current file.

Offline

#6 2007-04-13 02:28:21

Jessehk
Member
From: Toronto, Ontario, Canada
Registered: 2007-01-16
Posts: 152

Re: Rank Mirrors

Ramses de Norre wrote:

Save it in a file like eg. rankMirrors.py and run python ranMirrors.py /etc/pacman.d/current to rank the servers in the current file.

I may be extremely stupid, but the rankmirrors script included with pacman 3 didn't edit the file specified, but rather output the new file to stdout.

I had to:

rankmirrors /etc/pacman.d/current > /etc/pacman.d/current_new

in order for anything to happen.

Offline

#7 2007-06-23 18:05:58

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: Rank Mirrors

Jessehk wrote:

I had to:

rankmirrors /etc/pacman.d/current > /etc/pacman.d/current_new

in order for anything to happen.

You mean to say that one needs to run rankmirror and save the file with some different name and then delete old files and rename the newly created files to old names (eg current_new to current) to get any benefit of rankmirror. I ran rankmirror and it gave a list of servers (i guess in order of responsiveness). Isnt thats all what we need to do?

Last edited by ravisghosh (2007-06-23 18:06:32)

Offline

#8 2007-06-23 18:52:33

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Rank Mirrors

You need to set the servers in your conf file (e.g. /etc/pacman.d/current for current) in the order rankmirror gave them to you.

Offline

#9 2007-06-24 10:30:27

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: Rank Mirrors

So, doing

 rankmirror /etc/pacman.d/current > /etc/pacman.d/current_new

and then deleting current and renaming current_new to current is what we need to do.

Offline

#10 2007-06-24 14:45:31

Jessehk
Member
From: Toronto, Ontario, Canada
Registered: 2007-01-16
Posts: 152

Re: Rank Mirrors

ravisghosh wrote:

So, doing

 rankmirror /etc/pacman.d/current > /etc/pacman.d/current_new

and then deleting current and renaming current_new to current is what we need to do.

Actually, with my very limited bash skills (which I'd very soon like to improve), I wrote a script called rankallmirrors.

I haven't tested it (I'm very temporarily on Ubuntu -- I'll be reinstalling Arch this afternoon), but it should do what you want.

#!/bin/bash

# edit this list appropriately to include the mirrors you want.
mirrors="current extra testing community"

root_UID=0
mirror_dir=/etc/pacman.d/
rankmirrors=/usr/bin/rankmirrors

if [ $UID != $root_uid ]; then
    echo "You don't have the privileges necessary to run this script."
    exit 1
elif [ ! -d $mirror_dir ]; then
    echo "Unable to locate pacman mirrors. Looked in ${mirror_dir}."
    exit 1
elif [ ! -e $rankmirrors ]; then
    echo "Unable to locate rankmirrors script. Do you have pacman >= 3.0 installed?"
    exit 1
fi

cd $mirror_dir
for mirror in $mirrors; do
    cp $mirror ${mirror}.bak
    $rankmirrors $mirror > ${mirror}.new
    mv ${mirror}.new $mirror
done

exit 0

Last edited by Jessehk (2007-06-24 14:51:26)

Offline

#11 2020-05-02 04:21:51

Cipher69969
Member
From: kerala
Registered: 2020-04-21
Posts: 11

Re: Rank Mirrors

backup mirrorlist

mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak

save it to pacman-mirror.sh

#!/bin/bash

if [ "$#" -eq 0 ]; then

rankmirrors /etc/pacman.d/mirrorlist.bak | sudo tee /etc/pacman.d/mirrorlist

else

rankmirrors -n $1 /etc/pacman.d/mirrorlist.bak | sudo tee /etc/pacman.d/mirrorlist

fi


usage -

  • for generating the mirror list

    ./pacman-mirror.sh 
  • for generating n fastest servers

    ./pacman-mirror.sh n

Last edited by Cipher69969 (2020-05-02 04:23:18)


reign the beast

Offline

#12 2020-05-02 06:44:11

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Rank Mirrors

Dude, you're replying to a 13 year old thread.
Please don't necrobump.

Offline

#13 2020-05-02 07:57:01

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

Re: Rank Mirrors


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