Skip to content

Instantly share code, notes, and snippets.

@MarkusRodler
Forked from bramtechs/upgrade-debian-wsl.md
Created December 5, 2023 12:42
Show Gist options
  • Select an option

  • Save MarkusRodler/4ac8be5572b7ab88052d92da6c26c033 to your computer and use it in GitHub Desktop.

Select an option

Save MarkusRodler/4ac8be5572b7ab88052d92da6c26c033 to your computer and use it in GitHub Desktop.

Revisions

  1. @bramtechs bramtechs revised this gist Sep 14, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion upgrade-debian-wsl.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Upgrade Debian 9 (current WSL) to Debian 12 (bookworm testing)

    As of writing the Debian distro for WSL (Windows Subsystem for Linux) is quite old.
    As of writing, the Debian distro for WSL (Windows Subsystem for Linux) is quite old.

    You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

  2. @bramtechs bramtechs revised this gist Sep 14, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions upgrade-debian-wsl.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Upgrade Debian 9, (current WSL) to Debian 12 (bookworm testing)
    # Upgrade Debian 9 (current WSL) to Debian 12 (bookworm testing)

    The Debian package for WSL (Windows Subsystem for Linux) is quite old.
    As of writing the Debian distro for WSL (Windows Subsystem for Linux) is quite old.

    You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

  3. @bramtechs bramtechs created this gist Sep 14, 2022.
    57 changes: 57 additions & 0 deletions upgrade-debian-wsl.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    # Upgrade Debian 9, (current WSL) to Debian 12 (bookworm testing)

    The Debian package for WSL (Windows Subsystem for Linux) is quite old.

    You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

    > - Root required
    > - Use at your own risk, preferably on a fresh installation.
    > - Choose 'yes' when Debian requests to restart services.
    1. Install and open Debian on WSL (if not already)

    ```bat
    wsl --install -d debian
    wsl -d debian
    ```

    2. Go into root

    ```bash
    sudo -s
    ```

    3. Upgrade Debian 9 to 10

    ```bash
    apt update -y && \
    apt upgrade -y && \
    echo "deb http://deb.debian.org/debian/ buster main
    deb http://deb.debian.org/debian/ buster-updates main
    deb http://security.debian.org/debian-security buster/updates main" > /etc/apt/sources.list && \
    apt update -y && \
    apt upgrade -y && \
    apt dist-upgrade -y
    ```

    4. Upgrade Debian 10 to 11

    ```bash
    echo "deb http://deb.debian.org/debian/ bullseye main
    deb http://deb.debian.org/debian/ bullseye-updates main" > /etc/apt/sources.list && \
    apt update -y && \
    apt upgrade -y && \
    apt dist-upgrade -y
    ```

    5. Debian 11 to 12

    ```bash
    echo "deb http://deb.debian.org/debian/ bookworm main
    deb http://deb.debian.org/debian/ bookworm-updates main" > /etc/apt/sources.list && \
    apt update -y && \
    apt upgrade -y && \
    apt dist-upgrade -y && \
    apt autoremove -y && \
    exit
    ```