Skip to content

Instantly share code, notes, and snippets.

@zhonger
Created January 11, 2018 08:59
Show Gist options
  • Save zhonger/ae42a78c30dd0c362911b14c9adc198b to your computer and use it in GitHub Desktop.
Save zhonger/ae42a78c30dd0c362911b14c9adc198b to your computer and use it in GitHub Desktop.
#!/bin/bash
Version=$(lsb_release -c --short)
Codename=$(lsb_release -r --short)
OSArch=$(uname -m)
Source="deb https://mirrors.shu.edu.cn/ubuntu/ ${Version} main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version} main restricted universe multiverse\n"
Source=${Source}"deb https://mirrors.shu.edu.cn/ubuntu/ ${Version}-security main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version}-security main restricted universe multiverse\n"
Source=${Source}"deb https://mirrors.shu.edu.cn/ubuntu/ ${Version}-updates main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version}-updates main restricted universe multiverse\n"
Source=${Source}"deb https://mirrors.shu.edu.cn/ubuntu/ ${Version}-backports main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version}-backports main restricted universe multiverse"
cd /etc/apt/
mv sources.list sources.list.bak
echo $Source >> sources.list
apt-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment