0%

WSL-Ubuntu-18.04 阿里云源

windows subsystem linux ubuntu 安装的版本默认源仓库在国外,此文为替换国内源一个记录,同时适用于所有 Ubuntu-18.04 系统

阿里云源地址:https://developer.aliyun.com/mirror/

_#### 查看现有 ubuntu 软件源信息

1
cat /etc/apt/sources.list

结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# See [http://help.ubuntu.com/community/UpgradeNotes](http://help.ubuntu.com/community/UpgradeNotes) for how to upgrade to
# newer versions of the distribution.
deb [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic main restricted
# deb-src [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic-updates main restricted
# deb-src [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic universe
# deb-src [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic universe
deb [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic-updates universe
# deb-src [http://archive.ubuntu.com/ubuntu/](http://archive.ubuntu.com/ubuntu/) bionic-updates universe
....

_#### 更换软件源

1
2
3
4
5
6
7
8
9
# 先备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak  

# 在替换
sudo sed -i "s/security.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list
sudo sed -i "s/archive.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list

# 后更新
sudo apt update