The script I use to streamline my fresh WSL2 (Ubuntu 22.04.1 LTS) setup.
Clone the repository:
git clone https://github.com/overflowy/wsl-init-script.gitChange into the directory:
cd wsl-init-scriptMake the script executable:
chmod +x wsl-init-script.shRun the script:
./wsl-init-script.shRestart WSL instance from PowerShell:
wsl --shutdown
ubuntugit clone https://github.com/overflowy/wsl-init-script.git && \
cd wsl-init-script && \
chmod +x wsl-init-script.sh && \
./wsl-init-script.sh- Permanently change the hostname to
$NEW_HOSTNAME - Change DNS to Cloudflare (1.1.1.1/1.0.0.1)
- Install all packages listed in
$PACKAGESand$DEPENDENCIES(using apt) - Install pipx and all the packages listed in
$PIPX_PACKAGES - Install fish shell
- Set it as the default shell
- Install fisher plugin manager
- Install all plugins listed in
$FISHER_PLUGINS - Set up some helpful aliases (such as
cheat) - Set up fzf keybindings
- Install zoxide
- Install asdf and all the plugins listed in
$ASDF_PLUGINSalong with the latest version for each plugin - Fix various annoyances
Whenever I feel that my WSL2 instances has become bloated, I just run wsl --unregister Ubuntu and re-run the script. Nothing feels better than a clean, fresh distro.