溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

WSL安裝的示例分析

發(fā)布時(shí)間:2021-06-12 11:55:47 來(lái)源:億速云 閱讀:184 作者:小新 欄目:編程語(yǔ)言

這篇文章主要介紹了WSL安裝的示例分析,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

1.啟用Windows10子系統(tǒng)功能

在控制面板-啟用或關(guān)閉Windows功能中設(shè)置啟用適用于Linux的Windows子系統(tǒng),重啟系統(tǒng)。

WSL安裝的示例分析

WSL安裝的示例分析

2.安裝子系統(tǒng)

1.通過(guò)應(yīng)用商店下載安裝;

官方文檔:https://docs.microsoft.com/zh-cn/windows/wsl/install-win10

2.通過(guò)手動(dòng)下載進(jìn)行安裝;

官方文檔:https://docs.microsoft.com/zh-cn/windows/wsl/install-manual

安裝通過(guò)Windows PowerShell執(zhí)行命令:Add-AppPackage 包名

3.啟動(dòng)子系統(tǒng)

查看系統(tǒng)安裝的子系統(tǒng): wsl --list --verbose

啟動(dòng)子系統(tǒng):

  1. 通過(guò)安裝的子系統(tǒng)終端打開(kāi);

  2. 通過(guò)命令打開(kāi),例如ubuntu 20.04可以在Windows終端執(zhí)行 ubuntu2004 進(jìn)入子系統(tǒng)。

4.創(chuàng)建用戶

啟動(dòng)子系統(tǒng)后,系統(tǒng)會(huì)要求創(chuàng)建用戶。根據(jù)系統(tǒng)提示創(chuàng)建用戶名,密碼。

官方文檔:https://docs.microsoft.com/zh-cn/windows/wsl/user-support

5.修改源

wsl 中執(zhí)行: sudo vi /etc/apt/sources.list

在文件末尾添加:

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty main restricted universe multiverse

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main restricted universe multiverse

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main restricted universe multiverse

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main restricted universe multiverse

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main restricted universe multiverse

deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty main restricted universe multiverse

deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main restricted universe multiverse

deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main restricted universe multiverse

deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main restricted universe multiverse

deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main restricted universe multiverse

文件保存后更新源,執(zhí)行命令:sudo apt update && sudo apt upgrade

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“WSL安裝的示例分析”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

wsl
AI