Windows_linux子系统换源

为windows下linux子系统切换国内软件源

目前(2019.5)window store中的常用linux子系统ununtu16.04 , 18.04 及debian9

查看linux版本

测试发现debian没有此命令

wcq@DESKTOP-KGIA0G1:~$ lsb_release -a    
No LSB modules are available.  
Distributor ID: Ubuntu               
Description:    Ubuntu 18.04.1 LTS   
Release:        18.04      
Codename:       bionic  

注意这边的Codename是bionic

备份原sources.list

$ sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup

然后在 /etc/apt/sources.list 中加入如下代码

# 阿里源ubuntu18.04
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse

#阿里源ubuntu16.04
deb http://mirrors.aliyun.com/ubuntu/ xenial main   
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main   
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main    
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main  

deb http://mirrors.aliyun.com/ubuntu/ xenial universe 
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe       
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe   
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main      
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main      
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe      
#阿里源debian9
deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
#你也可以把"Stretch"换成"jessie","wheezy"。分别对应Debian9,Debian8,Debian7版本。

你可能感兴趣的:(备份)