Skip to content

Instantly share code, notes, and snippets.

@jcxldn
Created June 7, 2020 11:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcxldn/0e8706b7e37de65fc62b0d30f668bb30 to your computer and use it in GitHub Desktop.
Save jcxldn/0e8706b7e37de65fc62b0d30f668bb30 to your computer and use it in GitHub Desktop.
jcx-switch-mirrors
#!/bin/sh
# --------------------------------------------------
# JCX CF CDN for Ubuntu
# --------------------------------------------------
# 1. Installs 'ca-certificates' if not available.
# 2. Switches mirrors.
# 3. Removes apt list caches. (Useful for docker!)
# --------------------------------------------------
# SUPPORTED MIRRORS
# --------------------------------------------------
# archive.ubuntu.com
# security.ubuntu.com
# ports.ubuntu.com
# old-releases.ubuntu.com
# --------------------------------------------------
apt-get update && apt-get install -y ca-certificates && sed -i 's/http:\/\/archive.ubuntu.com/https:\/\/ubuntu-cf-cdn.jcx.ovh/;s/http:\/\/security.ubuntu.com/https:\/\/ubuntu-security-cf-cdn.jcx.ovh/;s/http:\/\/ports.ubuntu.com/https:\/\/ubuntu-ports-cf-cdn.jcx.ovh/;s/http:\/\/old-releases.ubuntu.com/https:\/\/ubuntu-old-releases-cf-cdn.jcx.ovh/' /etc/apt/sources.list && rm -rf /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment