Upgrading WSL2 Ubuntu LTS 22.04 to LTS 24.04…

After fixing WSL networking issues, I had to upgrade the Ubuntu LTS instance… The sequence should have been:

  • apt update
  • apt upgrade -y
  • apt dist-update
  • lsb_release -a   # to confirm version before upgrade
  • do-release-upgrade
  • lsb_release -a   # to confirm version after upgrade

But, as per usual, I hit another issue attempting to upgrade (i.e. while running do-release-upgrade):

error: cannot list snaps: cannot communicate with server: Get "http://localhost/v2/snaps": dial unix /run/snapd.socket: connect: no such file or directory

A quick ‘net search brought up the point that snapd was not running…

The search also noted that I needed to use systemd instead of init

To fix it, I had to edit my /etc/wsl.conf and add:

[boot]
systemd=true

A wsl --shutdown from Windows (as an Administrator, of course) and a restart and all was well…

Leave a Reply