Skip to content

Instantly share code, notes, and snippets.

@brunodrugowick
Created December 27, 2021 14:30
Show Gist options
  • Save brunodrugowick/0c4804dd737b217b0129d6e7682ee49a to your computer and use it in GitHub Desktop.
Save brunodrugowick/0c4804dd737b217b0129d6e7682ee49a to your computer and use it in GitHub Desktop.
Snaps got disconnected (?) after Ubuntu upgrade (18.04 to 20.04). This fixes them.
#!/bin/bash
# Thanks to: https://gitlab.com/Aviksaikat/snap_fix_kali_debian
# Snaps got disconnected (?) after Ubuntu upgrade. This fixes them.
# Lists all snaps
# Cut to get their names (first field)
# Tail to ignore first line
# While there's a new line, disable that snap then enable it
snap list | cut -d ' ' -f1 | tail -n +2 | while read line; do sudo snap disable $line && sudo snap enable $line; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment