Skip to content

Instantly share code, notes, and snippets.

@themegabyte
Forked from yusufhm/replace-apt-mirror.md
Created October 18, 2023 15:03
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 themegabyte/338c8669e0db3185ac20a517a07aa979 to your computer and use it in GitHub Desktop.
Save themegabyte/338c8669e0db3185ac20a517a07aa979 to your computer and use it in GitHub Desktop.
replace default apt with au mirror using Vim or sed

Replace default apt us mirror (http://us.archive.ubuntu.com/ubuntu/) to au mirror (http://au.archive.ubuntu.com/ubuntu/) in Vim:

:%s/us.archive.ubuntu.com/au.archive.ubuntu.com/g

Replace default apt us mirror (http://us.archive.ubuntu.com/ubuntu/) to au mirror (http://au.archive.ubuntu.com/ubuntu/) in Terminal:

# For MAC:
sed -i '' -e 's/us.archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list
# Other Linux:
sed -i -e 's/us.archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment