流程:
1.在应用商城下载linux for windows
2.安装chocolatey & LxRunOffline,移动linux到别的盘符
3.找一个靠谱终端
技巧点:
1.将linux系统转移到别的盘符上 ,使用LxRunOffline& Chocolatey
Chocolatey之于windows,就像brew之于macOS,是windows的包管理工具(package manager for windows),可以很方便地进行安装/卸载/更新各种软件包,在本文中是负责安装LxRunOffline包的一个工具。
LxRunOffline:A full-featured utility for managing Windows Subsystem for Linux (WSL)。使用目的:将GNU/Linux 发行版(distros)移动到外部盘符或分区。
参考:
https://chocolatey.org/install
https://github.com/DDoSolitary/LxRunOffline/blob/master/README.md
https://www.bilibili.com/read/cv1429071/
https://dev.to/domcorvasce/how-to-install-wsl-distros-on-external-disks-1d22
2.找一个好用的终端wsl_terminal
参考:
https://www.jianshu.com/p/df58be89b1fe
https://github.com/goreliu/wsl-terminal
https://blessing.studio/wsl-guide/
3.使用pycharm来访问
pycharm 2018.03之后的的版本支持远程连接WSL,方便了许多,注意不要踩以前的坑
参考:
https://www.jianshu.com/p/edfc1dab27a5
https://zhuanlan.zhihu.com/p/49227132
坑1:
当sudo apt install XXX会报错E: Unable to locate package XXX
解决方法:
step1: update apt or apt-get
sudo apt update
sudo apt-get update
if this not work, then step2
step2: configure /etc/apt/sources.list file <--一定要备份!
源文件参考:https://yq.aliyun.com/articles/639051
坑2:
在安装或更新软件时提示软件版本过高或过低而无法安装
解决方法:
软件源的版本要和使用的Linux版本一致。在网上查找对应版本的源文件
参考:
https://www.howtoing.com/linux-package-managers
https://blog.xcatliu.com/2016/04/25/setup_linux_workspace_in_windows/