Skip to content

Instantly share code, notes, and snippets.

@bofm
Last active September 26, 2015 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bofm/a4d3f351b687afa704c3 to your computer and use it in GitHub Desktop.
Save bofm/a4d3f351b687afa704c3 to your computer and use it in GitHub Desktop.
mirror.yandex.ru sources.list apt ubuntu
#!/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