1
WSL 备忘录
source link: https://www.liesauer.net/blog/post/899.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
经常需要捣鼓东西,所以老是要import一个纯净Ubuntu系统,记录一些经常需要用到的初始化命令,懒得记或者上网查。
顺便分享两个自己做的Ubuntu系统(仅适用于WSL/WSL2)
- Ubuntu-18.04-Default-2021_05_31.tar
微软商店下载后原封不动直接导出的快照
- Ubuntu-20.04-Lastest_22.03.04.tar
微软商店下载后进行
apt-get update
apt-get upgrade
后导出的快照
链接:https://pan.baidu.com/s/1No0Vxok2LKltlAutkPfihw
提取码:onku
wsl --import distro path\to\distro path\to\snapshot.tar --version 2
wsl --export distro path\to\snapshot.tar
修改root密码
sudo passwd
adduser username
添加sudoer
adduser username sudo
开启systemd
sudo nano /etc/wsl.conf
添加以下内容
[boot]
systemd=true
修改系统名
sudo nano /etc/wsl.conf
添加以下内容
[network]
hostname=XXXXX
默认登录用户
sudo nano /etc/wsl.conf
添加以下内容
[user]
default=username
默认登录路径
nano ~/.bashrc
添加以下内容
cd ~
apt镜像源
能不用就不用,除非完全下不动,国产源经常更新不及时、缺东西,安装东西时会报一堆摸不着头脑的依赖问题,网上给的换一个安装工具的解决方案没有用的!!!亲身经历!!!
加入docker组
sudo usermod -aG docker username
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK