To select Debian as default distro:
wslconfig /s debian| #!/bin/sh | |
| # sudo nano /etc/apt/sources.list | |
| # Comment out stable sources, add: | |
| # deb http://http.us.debian.org/debian unstable main non-free contrib | |
| # deb-src http://http.us.debian.org/debian unstable main non-free contrib | |
| # Perform full upgrade | |
| # sudo apt update | |
| # sudo apt full-upgrade | |
| # Set home dir and shell, edit proper line: | |
| # sudo nano /etc/passwd | |
| # priyadarshan:x:1000:1000:,,,:/mnt/c/home:/usr/bin/zsh | |
| # Finally, install needed tools | |
| sudo DEBIAN_FRONTEND=noninteractive apt -yq install autossh git zsh wget curl notmuch isync emacs aspell hunspell parallel picolisp sbcl man apt-file w3m fd-find ripgrep gcc make youtube-dl | |
| # Add wsl.conf (it should not be there) | |
| # sudo nano /etc/wsl.conf | |
| cat << 'EOF' | sudo tee /etc/wsl.conf | |
| # Enable extra metadata options by default | |
| [automount] | |
| enabled = true | |
| # This would mount C: drive as /c, not /mnt/c | |
| # root = / | |
| options = "metadata,umask=22,fmask=11" | |
| mountFsTab = false | |
| # Enable DNS – even though these are turned on by default, | |
| # we’ll specify here just to be explicit. | |
| [network] | |
| generateHosts = true | |
| generateResolvConf = true | |
| EOF | |
| # Uninstall if already installed | |
| # Get-AppxPackage TheDebianProject.DebianGNULinux | Remove-AppPackage | |
| # This is link to Debian on Microsoft Store | |
| # https://www.microsoft.com/store/productId/9MSVKQC78PK6 | |
| # Use this to verify: https://store.rg-adguard.net/ | |
| $URL = 'http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/1263b2f8-5626-45cc-b018-eebfee500d1a?P1=1577367893&P2=402&P3=2&P4=eEoWa4I%2bes8l%2fY4lpnyc8vZa8WDRp1chNpZJf76YyeQVQMKxHSfjhwRvzr3pbld9yzi4irJjd0iFlv%2bjGEzAUg%3d%3d' | |
| # $Filename = "$(Split-Path $URL -Leaf).appx" | |
| $Filename = 'wsl-debian-gnulinux.appx' | |
| # $ProgressPreference = 'SilentlyContinue' | |
| $ProgressPreference = 'Continue' | |
| Invoke-WebRequest -Uri $URL -OutFile $Filename -UseBasicParsing | |
| Add-AppxPackage $Filename | |
| # This will run the post-install (create user, etc) | |
| debian.exe |
Invoke with: