查看版本
查看系統(tǒng)版本译隘,快捷鍵Win+R打開運(yùn)行颠黎,輸入winver
羡蛾,打開“關(guān)于Windows”蒋情,查看當(dāng)前Windows10版本丁眼。
關(guān)于Windows
開啟開發(fā)者選項(xiàng)
打開【開始】>【設(shè)置】>【更新和安全】>【開發(fā)者選項(xiàng)】>【開發(fā)人員模式】
啟用適用于Linux的Windows子系統(tǒng)
適用于Linux的Windows子系統(tǒng)
安裝Microsoft Store
在【開始】菜單中找到PowerShell筷凤,右鍵【以管理員身份運(yùn)行】,輸入命令。
$ Get-AppxPackage -allusers | Select Name, PackageFullName
Microsoft.WindowsStore Microsoft.WindowsStore_12104.1001.1.0_x64__8wekyb3d8bbwe
安裝Windowns Store
$ Add-appxpackage -register "C:\Program Files\WindowsApps\Microsoft.WindowsStore_12104.1001.1.0_x64__8wekyb3d8bbwe\appxmanifest.xml" -disabledevelopmentmod
安裝成功后藐守,在【開始】菜單中出現(xiàn)Microsoft Store挪丢。
下載安裝Linux系統(tǒng)
在Microsoft Store中搜索Linux獲取Ubuntu,獲取后安裝然后啟動(dòng)卢厂。
ubuntu
配置新賬戶和密碼乾蓬,同時(shí)修改默認(rèn)root的密碼。
$ sudo passwd root
使用Cmder打開Ubuntu
- 下載Cmder命令行工具
- 輸入
bash
命令會(huì)自動(dòng)進(jìn)入U(xiǎn)buntu系統(tǒng) - 設(shè)置啟動(dòng)為L(zhǎng)inux的Bash環(huán)境慎恒,進(jìn)入設(shè)置選擇啟動(dòng)任内。
啟動(dòng)進(jìn)入U(xiǎn)buntu
%windir%\system32\bash.exe ~ -cur_console:p:n
查看當(dāng)前Ubuntu版本的代號(hào)為focal
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
修改Ubuntu默認(rèn)的下載鏡像為阿里云
$ cd /etc/apt/
$ sudo cp sources.list sources.list.ori
查找對(duì)應(yīng)Ubuntu版本的阿里源
$ sudo vim sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更新鏡像并升級(jí)
$ sudo apt update
$ sudo apt upgrade
查看Ubuntu防火墻
$ sudo ufw status
Status: inactive
關(guān)閉Ubuntu防火墻
$ sudo ufw disable
允許外部訪問本機(jī)
$ sudo ufw default allow
Ubuntu安裝配置Python
$ sudo apt install python
$ python --version
Python 2.7.18
切換到root下沒有顏色標(biāo)識(shí),將默認(rèn)用戶下的配置拷貝到root目錄下融柬。(無效)
$ cp /home/junchow/.bashrc /home/.bashrc
Ubuntu安裝成功后會(huì)自動(dòng)將本機(jī)磁盤掛載到Ubuntu的/mnt
目錄下