wsl更新內核編譯
1. 閰掑簵wsl鏄浠涔堟剰鎬
wsl鏄緗戠粶嫻佽岃錛屽湪涓嶅悓鍦烘櫙鐨勬剰鎬濓細
閰掑簵閲屾寚鈥滈厭搴椾腑鍏鋒湁鏈夌湡姝g殑綆$悊鍨嬩漢鎵嶁濈殑縐板懠銆
鍦ㄩキ鍦堟槸鈥滄垜姝諱簡鈥濈殑鎰忔濓紝娓告垙閲屽父瑙佸埌鐨剆dl swl,鎰忔濇槸"鏄澶т漿鈥,鎴戞諱簡鈥濓紝鐨勬剰鎬濄
鎵╁睍璧勬枡錛
wsl鏄涓浜涚粍浠剁殑闆嗗悎錛屽厑璁稿師鐢熺殑linuxELF64浜岃繘鍒舵枃浠惰窇鍦╓indows涓娿傚畠鍚屾椂鍖呮嫭浜嗙敤鎴鋒佸拰鍐呮牳鎬佺粍浠訛紝涓昏佸寘鍚浠ヤ笅閮ㄥ垎錛
1. 鐢ㄦ埛鎬佷細璇濈$悊鏈嶅姟澶勭悊Linux瀹炰緥鐨勭敓鍛藉懆鏈熴
2. Pico provider drivers (lxss.sys, lxcore.sys)鈥滅炕璇戔濈郴緇熻皟鐢錛屼互妯℃嫙Linux鍐呮牳銆
3. Pico 榪涚▼綆$悊鍘熺敓鐨勭敤鎴鋒丩inux錛堟瘮濡/bin/bash)銆
2. 鍏充簬win11涓嬪畨瑁匲buntu鎵句笉鍒癢slRegisterDistribution failed with error: 0x800701bc
褰撳湪鎺у埗闈㈡澘=>紼嬪簭=>鍚鐢ㄥ拰鍏抽棴Window鍔熻兘涓寮鍚浜嗕笅闈涓ら」鍔熻兘榪樻姤閿
鏇存柊Linux鍐呮牳鍖
3. scoop install dark瀹夎呭け璐ワ紵
1 姒傝堪
浣滀負涓鍚嶄嬌鐢 win10 鐨勫紑鍙戣咃紝鎼寤哄紑鍙戠幆澧冨線寰鏄涓浠舵瘮杈冪棝鑻︾殑浜嬶紝闇瑕佷粠緗戜笂涓嬭澆鍚勭嶈蔣浠訛紝鍦ㄧ數鑴戜笂閰嶇疆涓嶅悓杞浠惰繍琛岀幆澧冿紝瀵硅蔣浠惰繘琛屽悇縐嶈劇疆錛屼笉浠呰楁椂錛岃屼笖瀹規槗鍑虹幇鍚勭嶉棶棰樸傛惌寤虹殑鐜澧冭繕浼氬瓨鍦ㄤ笅闈涓浜涢棶棰橈細
瀹夎呭ぇ閲忕▼搴忛犳垚璺寰勬薄鏌撱傚畨瑁呭拰鍗歌澆姣旇緝楹葷儲銆傚紑鍙戠幆澧冧笉鑳借縼縐伙紝閲嶈呯郴緇熸垨鑰呮崲鐢佃剳闇瑕侀噸鏂版惌寤哄紑鍙戠幆澧冦傝蔣浠剁増鏈涓嶅ソ鎺у埗銆備負浜嗚В鍐充笂闈㈣繖浜涢棶棰橈紝鎴戜滑鍙浠ヤ嬌鐢 WSL+Docker+Scoop 鎼寤哄紑鍙戠幆澧冿紝鍙栦唬閫氳繃鍥懼艦鐣岄潰瀹夎呰蔣浠跺拰 VMware 瀹夎 Linux 鐜澧冪殑浼犵粺鏂瑰紡銆
WSL 鏄閫傜敤浜 Linux 鐨 Windows 瀛愮郴緇, 鍙璁╁紑鍙戜漢鍛樻寜鍘熸牱榪愯 GNU/Linux 鐜澧 - 鍖呮嫭澶у氭暟鍛戒護琛屽伐鍏楓佸疄鐢ㄥ伐鍏峰拰搴旂敤紼嬪簭 - 涓斾笉浼氫駭鐢熶紶緇熻櫄鎷熸満鎴栧弻鍚鍔ㄨ劇疆寮閿銆
Docker 鏄涓涓寮婧愮殑搴旂敤瀹瑰櫒寮曟搸錛岃╁紑鍙戣呭彲浠ユ墦鍖呬粬浠鐨勫簲鐢ㄤ互鍙婁緷璧栧寘鍒頒竴涓鍙縐繪嶇殑瀹瑰櫒涓錛岀劧鍚庡彂甯冨埌浠諱綍嫻佽岀殑 Linux 鏈哄櫒鎴 Windows 鏈哄櫒涓娿
Scoop 鏄 Windows 鐨勫懡浠よ屽畨瑁呯▼搴忥紝鍙浠ヨ╂垜浠浠庡懡浠よ屼互鏈灝忕殑瀹夎呴噺瀹夎呯▼搴忥紝 瀹冩秷闄や簡瀹夎呯晫闈㈠拰瀹夎呯▼搴忛犳垚鐨勮礬寰勬薄鏌擄紝瀹冨畨瑁呭拰鍗歌澆杞浠跺彧闇涓琛屽懡浠ゅ氨鍙浠ュ畬鎴愶紝瀹冭繕鍙浠ラ殢鎰忓垏鎹㈣蔣浠剁殑鐗堟湰銆
涓涓瀹屾暣鐨勫紑鍙戠幆澧冪粍鎴愶細棣栧厛浣跨敤 WSL 鎼寤轟竴涓 Linux 鐜澧冿紝鐒跺悗鍦 Linux 鐜澧冮噷瀹夎 Docker 搴旂敤錛屼嬌鐢 Docker 鏉ュ畨瑁呬竴浜涘父鐢ㄨ蔣浠訛紝姣斿傛暟鎹搴撱亀eb 鐜澧冪瓑錛孲coop 鍒欐槸鍦ㄦ湰鏈轟笂瀹夎呬竴浜涘紑鍙戠敤鍒扮殑杞浠訛紝姣斿 jdk銆乵aven銆乮dea 絳夈俉SL 鍜 Scoop 閮芥槸姣旇緝瀹規槗澶囦喚鍜岃繕鍘熺殑錛岃繖涓や釜鎼寤哄ソ浜嗭紝鎴戜滑鍒╃敤澶囦喚榪樺師鍙浠ュ揩閫熷湪鍙︿竴鍙版満鍣ㄤ笂鎼寤哄悓鏍風殑涓濂楃幆澧冿紝涓嬮潰鏄鎼寤虹幆澧冪殑鍏蜂綋嫻佺▼銆
2 WSL
2.1 WSL 瀹夎
浣跨敤 WINDOWS 閿 + R錛岃緭鍏 winver錛屾鏌 win10 鐗堟湰錛岀『淇濆唴閮ㄧ増鏈鍙鋒槸 18362.1049 浠ヤ笂錛屽惁鍒欐洿鏂 win10 鍒版渶鏂扮増鏈銆
鍥劇墖
2. 浠ョ$悊鍛樿韓浠芥墦寮 PowerShell 騫惰繍琛屼笅闈㈠懡浠わ細
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
鍥劇墖
3. 閲嶆柊鍚鍔ㄨ$畻鏈恆
4. 涓嬭澆 Linux鍐呮牳鏇存柊鍖匸1]錛岀劧鍚庡畨瑁呫
5. 灝 wsl2 璁劇疆涓洪粯璁ょ増鏈, 浠ョ$悊鍛樿韓浠芥墦寮 PowerShell 騫惰繍琛屼笅闈㈠懡浠わ細
wsl --set-default-version 2
鍥劇墖
6. 瀹夎 Ubuntu 20.04 LTS, 鎵撳紑 Microsoft Store[2]錛屾悳緔 Ubuntu 20.04 LTS[3] 瀹夎, 瀹夎呭畬鎴愬悗鎵撳紑 Ubuntu 20.04 LTS, 絳夊欏嚑鍒嗛挓浼氭彁紺鴻劇疆鐢ㄦ埛鍚嶅拰瀵嗙爜錛屽傛灉涓嶈劇疆鐢ㄦ埛鍚嶅拰瀵嗙爜鐩存帴鍏抽棴紿楀彛鍒欓粯璁や互 root 鐧誨綍錛岃繖閲屾垜浠鐩存帴鍏抽棴紿楀彛錛屼笉璁劇疆鐢ㄦ埛鍚嶅拰瀵嗙爜銆
鍥劇墖
7. 鐒跺悗閲嶆柊鎵撳紑 Ubuntu 20.04 LTS 灝變細榪涘叆 Ubuntu 20.04 LTS浜嗭紝鎴戜滑涔熷彲浠ュ湪 powershell 浣跨敤 wsl 榪欎釜鍛戒護榪涘叆 Ubuntu 20.04 LTS銆
2.2 WSL 閰嶇疆
WSL 姣忔″惎鍔ㄥ悗錛寃indows 閮戒細緇欏畠鍒嗛厤涓涓闅忔満鐨 IP 鍦板潃錛岃繖鏍鋒槸涓嶅埄浜庢垜浠璁塊棶 docker 閲岀殑鏈嶅姟鐨勶紝涓轟簡瑙e喅榪欎釜闂棰橈紝鎴戜滑鍙浠ュ壋寤轟竴涓鑴氭湰鏂囦歡 wsl2-ip.bat鏉ョ粰 wsl 鍒嗛厤涓涓鍥哄畾鐨 IP錛屽湪姣忔″惎鍔 wsl 鍚庣敤綆$悊鍛樻潈闄愯繍琛岃繖涓鑴氭湰錛屾枃浠跺唴瀹瑰備笅錛
@echo off
setlocal enabledelayedexpansion
:: set wsl2 ip
wsl -u root ip addr | findstr "192.168.169.2" > nul
if !errorlevel! equ 0 (
echo wsl ip has set
) else (
wsl -d Ubuntu-20.04 -u root ip addr add 192.168.169.2/28 broadcast 192.168.169.15 dev eth0 label eth0:1
echo set wsl ip success: 192.168.169.2
)
:: set windows ip
ipconfig | findstr "192.168.169.1" > nul
if !errorlevel! equ 0 (
echo windows ip has set
) else (
netsh interface ip add address "vEthernet (WSL)" 192.168.169.1 255.255.255.240
echo set windows ip success: 192.168.169.1
)
pause
鍏朵腑 192.168.169.2 琛ㄧず Linux 鐨 IP 鍦板潃錛 192.168.169.1 琛ㄧず涓繪満鐨 IP 鍦板潃銆
鏈夋椂浼氶亣鍒 Ubuntu 20.04 LTS 鏃犳硶榪炴帴緗戠粶錛岃繖涓闈炲父閲嶈侊紝鎴戜滑鍙浠ヨ繍琛屼笅闈㈠懡浠よВ鍐籌細
sed -i '4d' /etc/resolv.conf
sed -i '3a\nameserver 8.8.8.8' /etc/resolv.conf
sed -i '4a\nameserver 114.114.114.114' /etc/resolv.conf
2.3 Ubuntu 閰嶇疆
2.3.1 鏇挎崲闀滃儚婧
1. 澶囦喚 sources.list 鏂囦歡錛岃繍琛屼笅闈㈠懡浠わ細
mv /etc/apt/sources.list /etc/apt/sources.list.bak
2. 鍒涘緩 source.list 鏂囦歡錛岃繍琛屼笅闈㈠懡浠わ細vim /etc/apt/sources.list
3. 鐒跺悗鍦ㄦ枃浠墮噷娣誨姞涓嬮潰鍐呭癸紝涓嬮潰婧愪換閫夊叾涓鍗沖彲銆
# 娓呭崕婧
# 榛樿ゆ敞閲婁簡婧愮爜闀滃儚浠ユ彁楂 apt update 閫熷害錛屽傛湁闇瑕佸彲鑷琛屽彇娑堟敞閲
deb https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-security main restricted universe multiverse
# 棰勫彂甯冭蔣浠舵簮錛屼笉寤鴻鍚鐢
# deb https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.e.cn/ubuntu/ focal-proposed main restricted universe multiverse
# 闃塊噷婧
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
# 涓縐戝ぇ婧
deb https://mirrors.ustc.e.cn/ubuntu/ focal main restricted universe multiverse
#deb-src https://mirrors.ustc.e.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.ustc.e.cn/ubuntu/ focal-updates main restricted universe multiverse
#deb-src https://mirrors.ustc.e.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.e.cn/ubuntu/ focal-backports main restricted universe multiverse
#deb-src https://mirrors.ustc.e.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.e.cn/ubuntu/ focal-security main restricted universe multiverse
#deb-src https://mirrors.ustc.e.cn/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.ustc.e.cn/ubuntu/ focal-proposed main restricted universe multiverse
#deb-src https://mirrors.ustc.e.cn/ubuntu/ focal-proposed main restricted universe multiverse
#緗戞槗163婧
deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
4. 榪涜屾洿鏂幫紝榪愯屼笅闈㈠懡浠わ細
apt update
apt upgrade -y
2.3.2 寮鍚 systemctl
瀹夎 daemonize 鍜宖ontconfig 杞浠訛紝榪愯屼笅闈㈠懡浠わ細apt install -y fontconfig daemonize
2. 榪愯 vim /etc/profile 鍛戒護錛屽湪鏈灝炬坊鍔犱笅闈㈠唴瀹癸細
SYSTEMD_PID=$(ps -ef | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')
if [ -z "$SYSTEMD_PID" ]; then
sudo /usr/bin/daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
SYSTEMD_PID=$(ps -ef | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')
fi
if [ -n "$SYSTEMD_PID" ] && [ "$SYSTEMD_PID" != "1" ]; then
exec sudo /usr/bin/nsenter -t $SYSTEMD_PID -a su - $LOGNAME
fi
3. 榪愯 vim /etc/sudoers 鍛戒護錛屽湪鏈灝炬坊鍔犱笅闈㈠唴瀹癸細
%sudo ALL=(ALL) NOPASSWD: /usr/sbin/daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
%sudo ALL=(ALL) NOPASSWD: /usr/bin/nsenter -t [0-9]* -a su - [a-zA-Z0-9]*
4. 鍒鋒柊 profile 鏂囦歡錛岃繍琛屼笅闈㈠懡浠:
source /etc/profile
2.3.2 寮鍚 ssh
璁劇疆 root 璐﹀彿鐨勫瘑鐮侊紝鐢ㄤ綔鍚庣畫鐧婚檰浣跨敤錛岃繍琛屼笅闈㈠懡浠:passwd root
鍥劇墖
2. 澶囦喚鍘熷嬬殑 sshd_config錛岃繍琛屼笅闈㈠懡浠わ細
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
3. 淇鏀 sshd_config 鏂囦歡錛岃繍琛屼笅闈㈠懡浠わ細
sed -i '15c Port 22' /etc/ssh/sshd_config
sed -i '17c ListenAddress 0.0.0.0' /etc/ssh/sshd_config
sed -i '34c PermitRootLogin yes' /etc/ssh/sshd_config
sed -i '58c PasswordAuthentication yes' /etc/ssh/sshd_config
4. 閲嶅惎 sshd錛岃繍琛屼笅闈㈠懡浠
systemctl restart sshd
2.4 Docker 瀹夎呬笌閰嶇疆
瀹樻柟鍜岄樋閲岀殑婧愰夋嫨鍏朵竴錛屽緩璁浣跨敤闃塊噷婧愶紝閫熷害蹇銆
2.4.1 瀹樻柟瀹夎
1. 鍗歌澆鏃х増鏈錛岃繍琛屼笅闈㈠懡浠わ細
apt-get remove docker docker-engine docker.io containerd runc
2. 鏇存柊 apt 杞浠跺寘緔㈠紩騫跺畨瑁呰蔣浠跺寘浠ュ厑璁 apt 閫氳繃 HTTPS 浣跨敤瀛樺偍搴擄紝榪愯屼笅闈㈠懡浠わ細
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
3. 娣誨姞 Docker 鐨勫畼鏂 GPG 瀵嗛掗錛岃繍琛屼笅闈㈠懡浠わ細
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4. 璁劇疆紼沖畾鐨勫瓨鍌ㄥ簱錛岃繍琛屼笅闈㈠懡浠わ細
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5. 瀹夎呮渶鏂扮増鏈鐨 Docker Engine 鍜屽瑰櫒錛岃繍琛屼笅闈㈠懡浠わ細
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
apt-mark hold docker-ce docker-ce-cli containerd.io
2.4.2 闃塊噷婧愬畨瑁
鍗歌澆鏃х増鏈錛岃繍琛屼笅闈㈠懡浠わ細apt-get remove docker docker-engine docker.io containerd runc
2. 鏇存柊 apt 杞浠跺寘緔㈠紩騫跺畨瑁呰蔣浠跺寘浠ュ厑璁 apt 閫氳繃 HTTPS 浣跨敤瀛樺偍搴擄紝榪愯屼笅闈㈠懡浠わ細
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
3. 娣誨姞 Docker 鐨勯樋閲 GPG 瀵嗛掗錛岃繍琛屼笅闈㈠懡浠わ細
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
4. 璁劇疆紼沖畾鐨勫瓨鍌ㄥ簱錛岃繍琛屼笅闈㈠懡浠わ細
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
5. 瀹夎呮渶鏂扮増鏈鐨 Docker Engine 鍜屽瑰櫒錛岃繍琛屼笅闈㈠懡浠わ細
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
apt-mark hold docker-ce docker-ce-cli containerd.io
2.4.3 閰嶇疆闀滃儚鍔犻
鍒涘緩 /etc/docker/daemon.json 鏂囦歡錛屽苟濉鍐欎互涓嬪唴瀹癸細
{
"registry-mirrors": ["https://docker.mirrors.ustc.e.cn/"]
}
3 Scoop
3.1 Scoop 瀹夎
1. 浠ョ$悊鍛樻潈闄愭墦寮 PowerShell 銆
2. 鑷瀹氫箟鐢ㄦ埛杞浠跺拰鍏ㄥ矓杞浠跺畨瑁呬綅緗錛岃繍琛屼笅闈㈠懡浠わ細
$env:SCOOP='D:\Softwares\Scoop\LocalApps'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
$env:SCOOP_GLOBAL='D:\Softwares\Scoop\GlobalApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
鍥劇墖
3. 閰嶇疆瀹夊叏絳栫暐浠ュ強瀹夎 Scoop錛岃繍琛屼笅闈㈠懡浠わ細
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
鍥劇墖
3.2 瀹夎呭け璐ヨВ鍐蟲柟妗堝傛灉鍙戠敓涓嬮潰閿欒錛岃繖鏄鍥犱負緗戠粶鍘熷洜鏃犳硶璁塊棶 GitHub銆
鍥劇墖
2. 璁塊棶 IP鍦板潃鏌ヨ㈢綉絝橻4]錛岃緭鍏raw.githubusercontent.com鍩熷悕錛屾煡璇㈠瑰簲鐨 IP 鍦板潃銆
鍥劇墖
3. 閰嶇疆 C:\Windows\System32\drivers\etc\hosts鏂囦歡錛屽湪淇鏀瑰墠璧嬩簣 hosts 鏂囦歡璇誨啓鏉冮檺銆
鍥劇墖
鍥劇墖
鍥劇墖
4. 淇鏀 host 鏂囦歡鍐呭瑰備笅錛岀涓鍒楁槸鏌ヨ㈠嚭鏉ョ殑ip鍦板潃錛岀浜屽垪鏄鍏跺瑰簲鐨勫煙鍚嶏紝涓闂存湁涓絀烘牸銆
鍥劇墖
5. 淇濆瓨鍚庨噸鏂拌繍琛屽畨瑁呭懡浠ゃ
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
3.3 Scoop 閰嶇疆
瀹夎 Scoop 榪愯屾墍闇瑕佺殑鍩虹杞浠訛細scoop install sudo
sudo scoop install 7zip git innounp dark -g
鍥劇墖
2. 榪愯屼笅闈㈠懡浠わ紝媯鏌Scoop榪樺瓨鍦ㄧ殑闂棰橈紝杈撳叆鎻愮ず榪愯岀殑鍛戒護錛屾潵瑙e喅瀛樺湪鐨勯棶棰橈紝濡傛灉浣犱嬌鐢ㄧ殑瀹夎呰礬寰勪笉鏄鎴戠殑璺寰勶紝璇蜂慨鏀瑰懡浠や腑鐨勮蔣浠跺畨瑁呬綅緗錛
scoop checkup
Add-MpPreference -ExclusionPath 'D:\Softwares\Scoop\LocalApps'
Add-MpPreference -ExclusionPath 'D:\Softwares\Scoop\GlobalApps'
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
鍥劇墖
3. 閰嶇疆杞浠朵粨搴擄紝瀹樻柟杞浠朵粨搴撶洰鍓嶆敹褰曠殑杞浠跺緢灝戱紝涓嶈凍浠ユ敮鎸佹垜浠鐨勪嬌鐢錛屾坊鍔犱笅闈㈢殑杞浠朵粨搴擄紝鑳借╂垜浠瀹夎呮洿澶氱殑杞浠訛細
scoop bucket add extras
scoop bucket add versions
scoop bucket add nightlies
scoop bucket add nirsoft
scoop bucket add php
scoop bucket add nerd-fonts
scoop bucket add nonportable
scoop bucket add java
scoop bucket add games
scoop bucket add jetbrains
scoop bucket add dorado https://github.com/chawyehsu/dorado
scoop bucket add Ash258 https://github.com/Ash258/Scoop-Ash258.git
scoop bucket add pleiades https://github.com/jfut/scoop-pleiades.git
scoop bucket add Scoop-Apps https://github.com/ACooper81/scoop-apps
scoop bucket add scoop-zapps https://github.com/kkzzhou/scoop-zapps
scoop bucket add lemon https://github.com/hoilc/scoop-lemon
scoop bucket add raresoft https://github.com/L-Trump/scoop-raresoft
鍥劇墖
4. 濡傛灉杞浠朵粨搴撴坊鍔犲け璐ワ紝榪樻槸鍥犱負緗戠粶鐨勫師鍥狅紝澶у跺彲浠ユ妸榪欎簺浠撳簱 fork 鍒拌嚜宸辯殑鐮佷簯璐︽埛涓嬶紝鐒跺悗鍐嶆坊鍔犮
5. 浣跨敤 aria2 鏉ュ姞閫熻蔣浠剁殑瀹夎咃細
scoop install aria2 -g
scoop config aria2-max-connection-per-server 16
scoop config aria2-split 16
scoop config aria2-min-split-size 1M
濡傛灉鎯沖叧闂 aria2錛屽彲浠ヨ繍琛 scoop config aria2-enabled false鍛戒護銆
3.4 Scoop 甯哥敤鍛戒護
# 鎼滅儲app
scoop search <搴旂敤鍚>
# 媯鏌ュ摢浜涜蔣浠舵湁鏇存柊
scoop status
# 鐗堟湰鍒囨崲
scoop reset <搴旂敤鍚>@<鐗堟湰鍒囨崲>
# 紱佹㈡煇app鏇存柊
scoop hold <搴旂敤鍚>
# 鏇存柊鎵鏈塧pp
scoop update *
# 瀹夎卆pp
scoop install <搴旂敤鍚>
#鍏ㄥ矓瀹夎卆pp
scoop install -g <搴旂敤鍚>
#瀹夎卐xtras杞浠舵簮涓嬬殑app
scoop install extras/<搴旂敤鍚>
# 鍗歌澆app
scoop uninstall <搴旂敤鍚>
# 鍗歌澆鍏ㄥ矓瀹夎呯殑app
scoop uninstall -g <搴旂敤鍚>
4 鎬葷粨
寮鍙戠幆澧冭蔣浠剁殑瀹夎呬笌閰嶇疆鍒拌繖閲屽氨瀹屾垚浜嗭紝鍒╃敤涓婇潰榪欎簺杞浠訛紝浣犲彲浠ュ揩閫熸惌寤 Java銆丟o銆丆++銆丳ython絳夊紑鍙戠幆澧冦
鍙傝冭祫鏂
[1]Linux鍐呮牳鏇存柊鍖: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
[2]Microsoft Store: https://aka.ms/wslstore
[3]Ubuntu 20.04 LTS: https://www.microsoft.com/store/apps/9n6svws3rx71
[4]IP鍦板潃鏌ヨ㈢綉絝: https://www.ipaddress.com/