Last active
September 26, 2015 09:10
-
-
Save bofm/a4d3f351b687afa704c3 to your computer and use it in GitHub Desktop.
mirror.yandex.ru sources.list apt ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cp /etc/apt/sources.list /etc/apt/sources.list_bkp | |
sed -ri 's/\/\/\w+\.ubuntu\.com/\/\/mirror\.yandex\.ru/' /etc/apt/sources.list | |
# OR | |
cat /etc/apt/sources.list | \ | |
python -c 'import re,sys; sys.stdout.write(re.sub(sys.argv[1], sys.argv[2], sys.stdin.read()))' \ | |
'//\w+\.ubuntu\.com' '//mirror.yandex.ru' > /etc/apt/sources.list1 | |
mv /etc/apt/sources.list1 /etc/apt/sources.list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment