MIRRORS="mirror.iranserver.com ir.ubuntu.sindad.cloud mirror.arvancloud.ir archive.ubuntu.petiak.ir ubuntu.hostiran.ir mirrors.pardisco.co ubuntu.pars.host mirror.0-1.cloud ubuntu.shatel.ir mirror.faraso.org repo.linuxmirrors.ir"; echo "🔍 Testing mirrors..."; BEST=$(for m in $MIRRORS; do p=$(ping -c 2 -W 1 $m | grep rtt | awk -F'/' '{print $5}' | cut -d. -f1); [ -n "$p" ] && echo "$p $m"; done | sort -n | head -1 | awk '{print $2}'); if [ -z "$BEST" ]; then echo "❌ No mirror found."; else echo "✅ Best speed: $BEST"; if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then sudo sed -i.bak "s|URIs: .*|URIs: http://$BEST/ubuntu/|" /etc/apt/sources.list.d/ubuntu.sources; elif [ -f /etc/apt/sources.list ]; then sudo sed -i.bak "s|http://[a-zA-Z0-9.-]*archive.ubuntu.com/ubuntu|http://$BEST/ubuntu|g" /etc/apt/sources.list; fi; sudo rm -rf /var/lib/apt/lists/* && sudo apt update; fi Post #217
908
Forwarded from XRay Channel
اگر بهدنبال بهترین Mirror برای رپازیتوریهای لینوکس هستید، این دستور را اجرا کنید؛ بهصورت خودکار سریعترین و مناسبترین Mirror را برای سیستم شما تنظیم میکند: