Windows 10 安装Debian子系统
2020-02-11 本文已影响0人
亻火子
一、打开此电脑(我的电脑),如下图步骤操作,确定后重启电脑。

二、进入微软应用商店搜索“debian”,选择“Debian”进入后点安装。

三、安装完成后点进启进入,设置用户名及密码,完成后就进入系统了;切换到root帐号使用sudo -i
命令,输入前边设置的用户密码。
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: hz
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
hz@DESKTOP-LJUDN83:~$ sudo -i
[sudo] password for hz:
root@DESKTOP-LJUDN83:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 111G 78G 34G 70% /
none 111G 78G 34G 70% /dev
none 111G 78G 34G 70% /run
none 111G 78G 34G 70% /run/lock
none 111G 78G 34G 70% /run/shm
none 111G 78G 34G 70% /run/user
cgroup 111G 78G 34G 70% /sys/fs/cgroup
C:\ 111G 78G 34G 70% /mnt/c
D:\ 301G 71G 230G 24% /mnt/d
E:\ 317G 23G 294G 7% /mnt/e
F:\ 316G 37G 280G 12% /mnt/f
可以看到本地磁盘也都挂载上了。
四、接下来是把软件源修改为国内,因为默认官方源服务器在国外,访问太慢。
修改软件源:vi /etc/apt/sources.list
,下面是我的,使用的是华为的。
#deb http://deb.debian.org/debian buster main
#deb http://deb.debian.org/debian buster-updates main
#deb http://security.debian.org/debian-security/ buster/updates main
#deb http://ftp.debian.org/debian buster-backports main
deb http://mirrors.huaweicloud.com/debian/ buster main
deb-src http://mirrors.huaweicloud.com/debian/ buster main
deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main
deb http://mirrors.huaweicloud.com/debian/ buster-updates main
deb-src http://mirrors.huaweicloud.com/debian/ buster-updates main
这样就安装完成了。