You are not logged in.
Since sortmirrors, or maybe it all falls upon netselect, has been broken for some time how what might be a quick and dirty way to accomplish the same task.
I dont really know the geographical location of the mirrors in pacman.d/ or how to find that information out.
Plus there might be other mirrors that I dont know about because they arent included in the file. I dont know...
Offline
Who said it was broken? I used it a few weeks ago and it was fine...
Offline
Who said it was broken? I used it a few weeks ago and it was fine...
This bug report
I tried using it a few days ago and it removed all my mirrors.
EDIT:
@ dibble
Does your diff fix it?
Offline
Nope my diff doesn't do much at all. Didn't know about that bug You could hunt for a netselect replacement
Offline
I thought sortmirrors was fixed, it worked fine for me last week, but I do remember it causing grief a while back. (Er I just noticed who posted the bug :oops:) Maybe its possible to remove the offending mirrors from the list or something... I don't know why its so random!
Dusty
Offline
I wrote a script to sort the mirros using the average response time reported from pinging each server six times. It'll create each sorted mirror include file in /etc/pacman.d/ as extra.sorted, current.sorted, testing.sorted, etc.
I'm not sure how entirely accurate it really is but I'll post a link to it if anyone is interested.
Offline
I wrote a script to sort the mirros using the average response time reported from pinging each server six times. It'll create each sorted mirror include file in /etc/pacman.d/ as extra.sorted, current.sorted, testing.sorted, etc.
I'm not sure how entirely accurate it really is but I'll post a link to it if anyone is interested.
Please do.
Offline
Please let me know if it seems accurate.
Offline
dibblethewrecker wrote:Who said it was broken? I used it a few weeks ago and it was fine...
This bug report
I tried using it a few days ago and it removed all my mirrors.
EDIT:
@ dibble
Does your diff fix it?
I had the same problem today, and found it was due to my firewall configuration.
I had blocked most of the icmp services, and it looks like netselect couldn't get a valid response from the servers and thus removed them.
after allowing icmp and restoring the original mirror files from abs, sortmirrors / netselect worked like normal again.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
I just tested your script. It worked fine. My server order didn't change very much actually...
Offline
That above link doesn't work.
I googled and here is the CORRECT URL
I included the code from the sortmirrors2 script below. I used this and it is awesome! Nice work!
#!/bin/bash
trap "cleanup; exit 1" INT
if [ $(id -u) -ne 0 ]; then
echo "You must be root user to run this program."
exit 1
fi
cleanup() {
[ -f /tmp/sortmirrors ] && rm -f /tmp/sortmirrors
[ -f /tmp/sorted ] && rm -f /tmp/sorted
}
cleanup
mirror_file="/etc/pacman.d/current"
ct=1
max_num=$(wc -l $mirror_file |awk {'print $1'})
while [ $ct -le $max_num ]; do
mirror=$(sed -n "$ct"p $mirror_file)
d_candidate=$(echo $mirror |grep ^Server |awk -F= {'print $2'} |sed 's|s||')
candidate=$(echo $d_candidate |awk -F "//" {'print $2'}
|awk -F/ {'print $1'})
if [ "$candidate" != "" ]; then
echo -e "Testing $candidate: \c"
testit="ping -c6 "$(echo $candidate)""
result=$($testit |tail -n1 |awk -F/ {'print $6'})
echo $d_candidate%$result >>/tmp/sortmirrors
right=$(sed -n '$p' /tmp/sortmirrors |awk -F% {'print $2'})
echo $right"ms"
fi
ct=$(($ct+1))
done
# sort mirrors
times=$(cat /tmp/sortmirrors |awk -F% {'print $2'} |sort -n)
ct=0
for t in $times; do
sorted[$ct]=$(grep $t /tmp/sortmirrors)
ct=$(($ct+1))
done
echo -e "#n[current]n#" >/tmp/sorted
for newentry in ${sorted[@]}; do
echo Server = $newentry >>/tmp/sorted
done
# get rid of appended calculated times
sed 's|%.*||g' /tmp/sorted -i /tmp/sorted
cp -f /tmp/sorted /etc/pacman.d/current.sorted
cp -f /tmp/sorted /etc/pacman.d/extra.sorted
sed -e 's|current|extra|g' /etc/pacman.d/extra.sorted -i /etc/pacman.d/extra.sorted
cp -f /tmp/sorted /etc/pacman.d/community.sorted
sed -e 's|current|community|g' /etc/pacman.d/community.sorted -i /etc/pacman.d/community.sorted
cp -f /tmp/sorted /etc/pacman.d/testing.sorted
sed -e 's|current|testing|g' /etc/pacman.d/testing.sorted -i /etc/pacman.d/testing.sorted
cp -f /tmp/sorted /etc/pacman.d/unstable.sorted
sed -e 's|current|unstable|g' /etc/pacman.d/unstable.sorted -i /etc/pacman.d/unstable.sorted
cp -f /tmp/sorted /etc/pacman.d/release.sorted
sed -e 's|current|release|g' /etc/pacman.d/release.sorted -i /etc/pacman.d/release.sorted
echo -e "n==> Append ".sorted" to your Include = line in /etc/pacman.conf to use the sorted mirrors."
cleanup
Offline
haha! I can't believe you found that through google 8)
I also wrote the same thing in python when I first learned the language:
http://infiditus.homelinux.org/arch/misc/sortmirrors.py
But I really don't know how accurate they are because they only use the average response times from pinging the server 6 times...
Offline
Still its a pretty cool script nice work
Offline