WSL瘦身(硬碟空間膨脹時的最佳方案)

iBonnie_愛邦尼
發佈於Ubuntu 個房間
閱讀時間約 1 分鐘
打開 PowerShell

關閉wsl 
wsl --shutdown

執行:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

iwr -useb https://raw.githubusercontent.com/okibcn/wslcompact/main/setup | iex

看一些指令
wslcompact -h

壓縮硬碟=>Ubuntu-20.04請根據你的真實使用實例作變更
wslcompact -c Ubuntu-20.04


實際操作結果從240G降至153G(多出快100G,目前試過成效最好的方法)

raw-image





移除該指令:
Remove-Item "$($env:PSModulePath.split(';')[0])/WslCompact" -Recurse -Force





 



    1會員
    63內容數
    記錄生活與技術的小細節
    留言0
    查看全部
    發表第一個留言支持創作者!