Fast Linux Package Mirrors
ForestRacks currently provides fast linux mirrors in 9 global locations. Mirrors are currently available for CentOS, Debian, and Ubuntu.
Automatically replace Ubuntu mirrors:
cp /etc/apt/sources.list /etc/apt/sources.list.bak
sed '/^#/d' /etc/apt/sources.list.bak | \
sed -E 's/(us|de|ru)\.archive\.ubuntu\.com/mirrors.forestracks.net/g' | \
while IFS='' read -r line || [[ -n "$line" ]]; do
if [[ $line == deb* ]]; then
if [[ $line == *security* ]]; then
# Replace the URL with security.ubuntu.com
echo "deb http://security.ubuntu.com/ubuntu `echo $line | awk '{print $3}'` `echo $line | awk '{print $4}'`"
else
# Replace the URL with mirrors.forestracks.net
echo $line | sed 's/archive\.ubuntu\.com/mirrors.forestracks.net/g'
fi
else
# Print line as it is
echo $line
fi
done > /etc/apt/sources.list
Last updated on