windows subsystem for linux – How to recover from accidentally deleting Snap from Ubuntu installed as a part of WSL1?

Seems like you stuck in a “deadlock” apt can’t run because snap is missing, and snap can’t be reinstalled because apt won’t run.

You need to remove the broken apt first!

  1. disable snap apt hook
sudo ls /etc/apt/apt.conf.d/ | grep -i snap
# something like: 20snapd.conf, otherwise adjust follow up
sudo mv /etc/apt/apt.conf.d/20snapd.conf /tmp/20snapd.conf.bak
  1. fix broken pkg
sudo apt --fix-broken install
  1. remove snap
sudo apt purge snapd
sudo apt autoremove

Read more here: Source link