Linux换源

目录
  1. Ubuntu
  2. Deepin
  3. DeepinV20
    1. Example
    2. Notices
  4. Arch

重装Linux,总是忘记换源,这里Mark一下,一来备忘,二来帮助他人

Ubuntu

1
2
sudo cp /etc/apt/sources.list /etc/apt/sourcesbak.list
sudo vim /etc/apt/sources.list

删除原来的,换成下面的一个就行。

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
28
29
30
31
32
33
# 中科大镜像源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# 阿里镜像源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ disco-proposed main restricted universe multiverse
1
sudo apt-get update

Deepin

前后步骤相同,不过更换内容不太一样

1
2
3
4
5
6
7
8
9
# 阿里
deb [by-hash=force] http://mirrors.aliyun.com/deepin lion main contrib non-free
#deb-src http://mirrors.aliyun.com/deepin lion main contrib non-free
# 科大
deb [by-hash=force] http://mirrors.ustc.edu.cn/deepin lion main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/deepin lion main contrib non-free
# 清华
deb [by-hash=force] https://mirrors.tuna.tsinghua.edu.cn/deepin lion main contrib non-free
#deb-src https://mirrors.tuna.tsinghua.edu.cn/deepin lion main contrib non-free

注意如果是测试版就把lion换成panda,大部分应该是用lion

DeepinV20

最新的V20系统,稍微有些不同
deepin20代号改为 apricot
格式一般是:

1
deb [by-hash=force]+$url$/deepin/+ apricot main contrib non-free

Example

1
deb [by-hash=force] https://mirrors.tuna.tsinghua.edu.cn/deepin/ apricot main contrib non-free

Notices

目前官方源链接有三部分
详细问题可以访问论坛
LINK

Arch

1
sudo vim /etc/pacman.conf

加上

1
2
3
4
5
[archlinuxcn]
#tsinghua
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
#ustc
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

或许需要安装GPGKEY

1
sudo pacman -S archlinuxcn-keyring

更新

1
sudo pacman -Sy