-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrepository.sh
executable file
·27 lines (21 loc) · 1.06 KB
/
repository.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
source_url="http://mirrors.aliyun.com/ubuntu/"
code_name=$(lsb_release -c | awk '{print $2}')
# 更换阿里源
echo -e "\033[1;31m 更换阿里源 \033[0m"
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cat <<EOF > /etc/apt/sources.list
deb ${source_url} ${code_name} main restricted universe multiverse
deb-src ${source_url} ${code_name} main restricted universe multiverse
deb ${source_url} ${code_name}-security main restricted universe multiverse
deb-src ${source_url} ${code_name}-security main restricted universe multiverse
deb ${source_url} ${code_name}-updates main restricted universe multiverse
deb-src ${source_url} ${code_name}-updates main restricted universe multiverse
deb ${source_url} ${code_name}-proposed main restricted universe multiverse
deb-src ${source_url} ${code_name}-proposed main restricted universe multiverse
deb ${source_url} ${code_name}-backports main restricted universe multiverse
deb-src ${source_url} ${code_name}-backports main restricted universe multiverse
EOF
# 更新和升级
apt-get -y update
apt-get -y upgrade