美文网首页
wsl-ubuntu安装使用

wsl-ubuntu安装使用

作者: 无玄 | 来源:发表于2021-07-09 14:48 被阅读0次

安装wsl

适用于 Linux 的 Windows 子系统安装指南 (Windows 10)

  1. 启用适用于 Linux 的 Windows 子系统
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  1. 安装所选的 Linux 分发
    a. 打开 Microsoft Store,并选择你偏好的 Linux 分发版。
    b. 手动下载适用于 Linux 的 Windows 子系统发行版包
    下载发行版本
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing

安装发行版本

Add-AppxPackage .\app_name.appx

WSL-Ubuntu18.04 LTS使用

重启

//以管理员权限运行cmd
net stop LxssManager //停止
net start LxssManager //启动

网络代理:

sudo vi ~/.bashrc
export http_proxy=http://user:passwd@proxyhost:proxyport
export https_proxy=http://user:passwd@proxyhost:proxyport

切换清华源

清华大学开源软件镜像站
sudo vi /etc/apt/source.list

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

sudo apt update

wsl-ubuntu迁移

wsl --export Ubuntu-18.04 d:\wsl-ubuntu18.04.tar
wsl --import Ubuntu-18.04 d:\wsl-ubuntu18.04 d:\wsl-ubuntu18.04.tar --version 2

wsl-ubuntu升级

sudo dpkg --force depends -P lxd
sudo dpkg --force depends -P lxd-client
sudo nano /etc/update-manager/release-upgrades
sudo do-release-upgrade

推荐文章

Windows 10 Ubuntu子系统的备份/还原教程
在Windows 10内置Ubuntu子系统上搭建私有云

相关文章

网友评论

      本文标题:wsl-ubuntu安装使用

      本文链接:https://www.haomeiwen.com/subject/bwhfpltx.html