I wanted to move an existing WSL installation from Ubuntu 24.04 to Ubuntu 26.04 without creating a second distro and manually copying everything across. The important requirement was to keep the existing contents: home directories, installed packages, shell configuration, SSH keys, WSL settings, scripts, and project files.

The approach in this post is an in-place release upgrade. It runs the Ubuntu release upgrade inside the existing Ubuntu-24.04 WSL instance. It is different from installing a new Ubuntu distro and importing files into it.

Quick answer

To upgrade the existing Ubuntu 24.04 WSL instance in place, update WSL itself, export a backup, update the current Ubuntu system, remove obsolete packages, install update-manager-core, configure the upgrader to allow LTS releases, and run sudo do-release-upgrade. If Ubuntu reports No new release found, retry with sudo do-release-upgrade -d only after confirming that the intended Ubuntu 26.04 release is available for your environment. When the upgrade finishes, run wsl --shutdown, start the distro again, and verify /etc/os-release. Your WSL registration may still be named Ubuntu-24.04; the operating-system version inside the instance is the authoritative result. Renaming the registration and its \\wsl.localhost\Ubuntu-24.04\ path requires a separate registry step.

What this upgrade keeps

An in-place upgrade works on the existing Linux filesystem. It is designed to keep:

  • Files under your home directory, such as /home/sea/project.
  • Installed Debian packages where the new Ubuntu release has compatible versions.
  • Shell configuration files such as .bashrc, .profile, and .zshrc.
  • SSH configuration and keys under ~/.ssh, subject to normal package and permission checks.
  • WSL configuration inside the distro, such as /etc/wsl.conf.
  • Project directories, scripts, virtual environments, and local configuration files.

The upgrade does not guarantee that every third-party repository, manually installed binary, kernel module, service, or language runtime will continue working unchanged. Ubuntu may disable third-party package sources during the release upgrade, and packages may be removed or replaced when dependencies change.

The WSL distro name is separate from the Ubuntu release name. If the existing registration is called Ubuntu-24.04, it may continue to appear under that name in Windows after the in-place upgrade. Do not use wsl --unregister Ubuntu-24.04 as part of this procedure. Unregistering deletes the distro filesystem.

Warning: back up before changing the release

Release upgrades can fail because of interrupted package operations, third-party repositories, low disk space, broken dependencies, or WSL-specific behavior. This can sometimes have issues on WSL, so a backup is strongly recommended.

The backup is a safety net, not a step to skip because the upgrade is supposed to preserve files. Make sure the Windows backup directory exists and has enough free space before exporting the distro.

Step 0: Update WSL itself

Before changing the Ubuntu release, update the WSL application from PowerShell:

wsl --update

This updates WSL’s Windows-side components. It is separate from updating Ubuntu packages with apt. If WSL reports that an update requires a restart, restart Windows before continuing. After the update, check the registered distro and version:

wsl --version
wsl --list --verbose

Do not continue until the distro is stopped cleanly and you know which registration name you are backing up.

Step 1: Export the current Ubuntu 24.04 instance

Run this from PowerShell, not from inside the Ubuntu terminal:

New-Item -ItemType Directory -Path C:\backup -Force
wsl --export Ubuntu-24.04 C:\backup\Ubuntu-24.04-backup.tar

The export can take a while. WSL writes the current distro filesystem into the TAR file, including the files and configuration stored inside the instance. Do not shut down Windows or interrupt the export while it is running.

Check that the file was created:

Get-Item C:\backup\Ubuntu-24.04-backup.tar |
    Select-Object FullName, Length, LastWriteTime

The export is only useful if it is readable and stored somewhere with enough free disk space. For important environments, copy the TAR to another disk after the export completes.

Optional: check the registered distro name first

If you are not certain that the distro is named Ubuntu-24.04, list the registered WSL distributions:

wsl --list --verbose

Use the exact name shown by WSL in the wsl --export command. Copying it exactly avoids exporting the wrong instance.

Step 2: Open the Ubuntu 24.04 terminal

Start the existing Ubuntu-24.04 terminal. Confirm that you are in the instance you intend to upgrade:

cat /etc/os-release
pwd
df -h /

The release information should identify Ubuntu 24.04. Check the root filesystem before starting because the upgrade needs temporary space for package downloads and unpacking. Remove only files you have already identified as safe to remove; do not delete project data just to make the command fit.

If you have important services, long-running shells, database processes, or development servers running in WSL, stop them before the upgrade. Keep a separate copy of any unsaved work outside the distro as well.

Step 3: Update the current system

Inside Ubuntu 24.04, update package indexes and apply all pending package upgrades:

sudo apt update && sudo apt full-upgrade -y

Remove packages that are no longer needed after the upgrade:

sudo apt autoremove -y

The full-upgrade step matters because the release upgrader expects the current release to be in a consistent, updated state. If apt reports broken dependencies, fix those before continuing. Do not proceed while package operations are unfinished.

Run autoremove only after reviewing the package list it proposes. It removes packages that apt considers no longer required, so do not accept the operation blindly on a development environment with manually installed tooling or unusual package dependencies.

Useful checks before moving on are:

sudo dpkg --audit
sudo apt --fix-broken install

Run the --fix-broken command only when apt reports dependency problems. If it changes packages, run the update and full upgrade again afterward.

Step 4: Install the release-upgrade tool

Make sure the Ubuntu release upgrade package is installed:

sudo apt install update-manager-core -y

This package provides do-release-upgrade, the command-line tool used to move between Ubuntu releases.

Step 5: Allow LTS upgrades

Edit the release-upgrade policy so the upgrader looks for LTS releases:

sudo sed -i 's/Prompt=.*/Prompt=lts/' /etc/update-manager/release-upgrades

Check the resulting setting:

grep '^Prompt=' /etc/update-manager/release-upgrades

The expected output is:

Prompt=lts

Using Prompt=lts is important when moving between numbered Ubuntu LTS releases such as 24.04 and 26.04. If the file does not contain a Prompt= line, open it with an editor and add Prompt=lts instead of assuming the sed command changed anything.

Step 6: Start the in-place release upgrade

Start the upgrade from inside the Ubuntu 24.04 terminal:

sudo do-release-upgrade

Follow the on-screen prompts carefully. The upgrader may ask about configuration files, services, obsolete packages, and whether to continue. Read each prompt before accepting the default.

Do not close the terminal, shut down WSL, or restart Windows while the upgrade is changing packages. The process may take time and can appear quiet while it is unpacking or configuring packages.

If it says “No new release found”

If the normal command reports:

No new release found

First check these points:

  • The current system is actually Ubuntu 24.04.
  • sudo apt update completed without repository errors.
  • Prompt=lts is present in /etc/update-manager/release-upgrades.
  • The WSL instance has network access and enough free disk space.
  • The target Ubuntu 26.04 release is available through the configured release-upgrade service.

If those checks are correct, try:

sudo do-release-upgrade -d

The -d option asks the upgrader to consider a development release. Use it deliberately. If Ubuntu 26.04 is already the intended available target, it can help when the normal LTS prompt has not detected the release yet. If 26.04 is not officially available for the machine, -d may select a development release instead. Do not continue just because the command offers a newer version; confirm the release name shown by the upgrader before accepting.

Step 7: Restart WSL after the upgrade

When do-release-upgrade finishes successfully, return to PowerShell and shut down all running WSL instances:

wsl --shutdown

Start the existing distro again:

wsl -d Ubuntu-24.04

The registration name may still be Ubuntu-24.04. That is expected for an in-place upgrade. The command starts the same instance whose files were upgraded.

Step 8: Verify the Ubuntu release

Inside the restarted WSL terminal, check the operating-system release:

cat /etc/os-release

You can also use:

lsb_release -a

Look for Ubuntu 26.04 in the PRETTY_NAME, NAME, or Description output. Check the kernel and WSL environment as well:

uname -a
printf 'WSL_DISTRO_NAME=%s\n' "$WSL_DISTRO_NAME"

The distro name variable may still say Ubuntu-24.04. That does not mean the release upgrade failed. Use /etc/os-release to verify the Linux distribution version.

Optional: rename the WSL registration to Ubuntu-26.04

An in-place Ubuntu upgrade changes the Linux release inside the distro, but it does not rename the WSL registration. The existing path may therefore remain:

\\wsl.localhost\Ubuntu-24.04\home\sea\project\pwshtips

The WSL registration name is stored in the current user’s registry. You can change the name without exporting and importing the filesystem, but stop WSL first and back up the registry key before editing it.

Fast rename script

Save this as Rename-WslDistro.ps1, then run it from PowerShell. The defaults rename Ubuntu-24.04 to Ubuntu-26.04:

param(
    [string]$CurrentName = 'Ubuntu-24.04',
    [string]$NewName = 'Ubuntu-26.04'
)

$lxssPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss'

Write-Host 'Stopping WSL...' -ForegroundColor Cyan
wsl --shutdown
if ($LASTEXITCODE -ne 0) {
    throw 'wsl --shutdown failed.'
}

$matches = @(foreach ($key in Get-ChildItem -Path $lxssPath) {
    $values = Get-ItemProperty -Path $key.PSPath -ErrorAction Stop
    if ($values.DistributionName -eq $CurrentName) {
        $key
    }
})

if ($matches.Count -eq 0) {
    throw "No WSL registration named '$CurrentName' was found. Run 'wsl -l -v' and check the name."
}

if ($matches.Count -gt 1) {
    throw "More than one registry entry matched '$CurrentName'. No changes were made."
}

$existingNames = @(foreach ($key in Get-ChildItem -Path $lxssPath) {
    (Get-ItemProperty -Path $key.PSPath -ErrorAction Stop).DistributionName
})
if ($existingNames -contains $NewName) {
    throw "A WSL registration named '$NewName' already exists. No changes were made."
}

$backupPath = Join-Path $PWD ("Lxss-backup-{0}.reg" -f (Get-Date -Format 'yyyyMMdd-HHmmss'))
& reg.exe export 'HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss' $backupPath /y | Out-Host
if ($LASTEXITCODE -ne 0) {
    throw "Registry backup failed. No changes were made."
}

Set-ItemProperty -Path $matches[0].PSPath -Name DistributionName -Value $NewName
Write-Host "Renamed '$CurrentName' to '$NewName'. Registry backup: $backupPath" -ForegroundColor Green
wsl -l -v

Run it like this:

.\Rename-WslDistro.ps1

The script refuses to continue if it cannot find exactly one matching DistributionName, if the new name already exists, or if the registry backup fails. Keep the generated .reg backup until the renamed distro has been tested.

Manual Registry Editor method

If you prefer to make the change manually:

  1. Run wsl --shutdown from PowerShell.
  2. Press Win + R, type regedit, and press Enter.
  3. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss.
  4. Click each GUID folder, such as {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}, until DistributionName is Ubuntu-24.04.
  5. Double-click DistributionName and change it to Ubuntu-26.04.
  6. Close Registry Editor and run wsl -l -v.

After the rename, the UNC path changes from:

\\wsl.localhost\Ubuntu-24.04\home\sea\project\pwshtips

to:

\\wsl.localhost\Ubuntu-26.04\home\sea\project\pwshtips

Registry editing changes the registration label and Windows-facing path; it does not change the Linux release. Verify the release separately with cat /etc/os-release, then check your home directory, SSH configuration, project files, and required commands.

Step 9: Verify that your contents are still present

Check the directories and files that mattered before the upgrade. For example:

pwd
ls -la ~
ls -la ~/project
test -f ~/.bashrc && echo '.bashrc is present'
test -d ~/.ssh && echo '.ssh directory is present'

Check installed packages that your workflow needs:

command -v git
command -v node
command -v pwsh
git --version
pwsh --version

Not every command will exist on every installation. Use the checks that match your own environment. The important comparison is between what existed before the upgrade and what is available afterward.

Also inspect services and development tools that use system packages:

systemctl --failed 2>/dev/null || true
git -C ~/project status --short 2>/dev/null || true

Third-party repositories may be disabled during the upgrade. Review /etc/apt/sources.list.d/ before re-enabling anything, and confirm that the repository supports Ubuntu 26.04. Re-enabling a repository built only for 24.04 can produce dependency conflicts.

If the upgrade fails

Do not unregister the distro in an attempt to repair it. The command below deletes the WSL instance and its contents:

wsl --unregister Ubuntu-24.04

Use the TAR backup instead. A recovery import should be performed into a new temporary distro name first so the original backup remains available:

wsl --import Ubuntu-24.04-Recovery C:\WSL\Ubuntu-24.04-Recovery C:\backup\Ubuntu-24.04-backup.tar --version 2

This creates a separate recovery instance. Verify its files before deciding what to do with the original distro. The import path must exist, and the target name must not already be registered.

In-place upgrade versus a new WSL instance

The in-place method is convenient because it preserves the existing filesystem and configuration in place. It is a good fit when the current distro is healthy, the backup is verified, and the goal is to keep the same development environment.

A new instance is cleaner when the current distro has years of obsolete repositories, broken packages, experimental services, or unclear configuration. A fresh import requires more manual work, but it also gives a clean baseline. Choose in-place when preserving the working environment is more important and you have a usable rollback backup.

Final checklist

Before considering the upgrade complete, confirm:

  • C:\backup\Ubuntu-24.04-backup.tar exists and is readable.
  • sudo apt update && sudo apt full-upgrade -y completed before the release upgrade.
  • wsl --update completed before the distro upgrade.
  • sudo apt autoremove -y was reviewed and completed where appropriate.
  • update-manager-core is installed.
  • /etc/update-manager/release-upgrades contains Prompt=lts.
  • sudo do-release-upgrade completed without an unresolved package error.
  • WSL was restarted with wsl --shutdown.
  • /etc/os-release reports Ubuntu 26.04.
  • The registration name and UNC path were left as Ubuntu-24.04 or were safely changed through the registry to Ubuntu-26.04.
  • Your home directory, projects, SSH configuration, and required commands are still present.
  • Third-party repositories were reviewed before being re-enabled.

The main point of this procedure is that Ubuntu is upgraded inside the existing WSL instance. The WSL registration may keep the old Ubuntu-24.04 label, but the filesystem, installed content, and project data remain in that same instance while the Linux release changes to Ubuntu 26.04.