You are not logged in.
Pages: 1
Topic closed
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
I think pacman 3 is still in testing... You can check your version with pacman -V.
Offline
Yes, pacman3 is still in testing. However, you can get the rankmirror script here:
http://cvs.archlinux.org/cgi-bin/viewcv … oot=Pacman
Offline
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
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
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
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
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
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
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
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
Dude, you're replying to a 13 year old thread.
Please don't necrobump.
Offline
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
Pages: 1
Topic closed