# windows 11 重新安裝 wsl-Ubuntu22.04 完整過程 ### 檢查版本與刪除 ```bash= wsl.exe -l wsl --unregister Ubuntu-22.04 # 小心使用會整個根目錄都刪除 ``` ### 安裝ubuntu2204 - 至 `microsoft store`搜尋並安裝ubuntu22.04LTS --- *gui 未出現設定所以從terminal設定* ### 使用者新增 ```bash= adduser <username> passwd ``` ### 切換預設使用者 `powershell` ```bash= ubuntu2204 config --default-user <username> ``` --- ### 新user sudoers 問題 - 解決 **xxx is not in the sudoers** ```bash= su - chmod u+x /etc/sudoers vim /etc/sudoers <username>.. # .. 和root 相同 chmod u-x /etc/sudoers ``` ### 下載script直接安裝需要的套件 想從[github](https://github.com/nirowu/ubuntu-setup)下載寫好的script的話,需要生成public key ```bash= cat ~/.ssh/id_rsa.pub # 有的可以直接複製 ssh-keygen -t rsa # 沒有的話先新增 ``` ### 外觀設定 1. `powershell setting` - color: *tango dark* - font: *MesloLGFGLDZ NFM* 2. **補充** 字體下載方式 - 使用字體 *nerd-fonts* using option6 ```bash= git clone --filter=blob:none --sparse git@github.com:ryanoasis/nerd-fonts cd nerd-fonts git sparse-checkout add patched-fonts/MesloNerdFont ``` 3. 更改自己喜歡的樣式 ```bash= p10k configure ``` --- ### Reference 1. [public-key](https://www.zhihu.com/question/21402411) 2. [nerd-font](https://github.com/ryanoasis/nerd-fonts) 3. [xxx is not in the sudoers](https://uiop7890.pixnet.net/blog/post/29385923)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up