windows10环境下安装Linux子系统---debian
一、前提
1、在控制面板-程序-启用与关闭Windows功能中,勾选“适用于Linux的Windows子系统”
2、首先需要创建一个文件夹,用来存放子系统,在需要的位置创建即可,文件夹名任意
3、手动下载Windows子系统发行版包,下载完需要的发行版包后,将后缀名为.appx
的文件放至上一步中的目录
下载地址: https://docs.microsoft.com/zh-cn/windows/wsl/install-manual
二、安装
1、双击压缩包安装即可
三、移动(本人电脑C盘满了,不需要将子系统移动的,可以跳过这个)
1、在安装子系统之前,我们需要下载一个东西 -> LxRunOffline 下载地址 (https://github.com/DDoSolitary/LxRunOffline/releases)
下载文件LxRunOffline-vxxxx.zip 然后解压到某个一个目录中,之后我们需要设置环境变量,使用这个东西去移动我们的子系统,所以不可以删除这个东西
右击”此电脑“->属性->高级系统设置,在高级面板中选择环境变量。选择系统变量中的Path变量,点击编辑按钮。
点击新建,并把刚刚LxRunOffline的解压地址粘贴到新的项目中。切记这个目录里必须包含LxRunOffline.exe文件
然后重启电脑,打开命令行工具,输入LxRunOffline,如果显示下面的提示证明已经安装成功了
2、打开命令行,输入LxRunOffline list 查看我们的子系统版本,我安装的是ubuntu18.04,例如显示这样的界面
移动命令: LxRunOffline move -n Ubuntu-18.04 -d D:\WinLinux
3、移动Debian的指令
LxRunOffline list
LxRunOffline move -n Debian -d D:\Debian
四、windows商店中下载windows terminal
安装这个的目的是Debian可以轻松访问电脑中其他磁盘
五、配置Debian镜像源
1、Debian系的源一般都是由下列文件提供
/etc/apt/sources.list
2、所以可以使用的方法有两个
- 第一个就是只替换域名
- 第二个则是全替换
3、替换域名
sed -i 's#http://deb.debian.org#https://mirrors.ustc.edu.cn#g' /etc/apt/sources.list
手动替换也行:
(1)由于用vi文本编辑器特别别扭,我先连上梯子,先更新apt包
apt update
(2)安装vim编辑器
apt install vim
(3)修改/etc/apt/sources.list文件,将里边的有关debian的根htpp地址替换成中科大的镜像地址:mirrors.ustc.edu.cn
替换后如下图所示,替换后还要执行:apt update
4、更新
apt update
5、各个源
163镜像站
- deb http://mirrors.163.com/debian/ buster main non-free contrib
- deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
- deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
- deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
- deb-src http://mirrors.163.com/debian/ buster main non-free contrib
- deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
- deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
- deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
华为云镜像站
- deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
- deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
- deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
- deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free
- deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
- deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
- deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
腾讯云镜像站
- deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
- deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
- deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
- deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
- deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
- deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
- deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
- deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
中科大镜像站
- deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
- deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
- deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
- deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
- deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
- deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
- deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
- deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
阿里云镜像站
- deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
- deb http://mirrors.aliyun.com/debian-security buster/updates main
- deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
- deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
- deb-src http://mirrors.aliyun.com/debian-security buster/updates main
- deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
- deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
- deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
清华大学镜像站
- deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
- deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
- deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
- deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
- deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
- deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
- deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
- deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
兰州大学镜像站
- deb http://mirror.lzu.edu.cn/debian stable main contrib non-free
- deb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
- deb http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
- deb http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free
- deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-free
- deb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
- deb-src http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
- deb-src http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free
上海交大镜像站
- deb https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
- deb https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
- deb https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
- deb https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free
- deb-src https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
- deb-src https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
- deb-src https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
- deb-src https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free