Browse Source

New ubuntu script: removeoldsnaps

master
Jan-Lukas Else 10 months ago
parent
commit
00f9787e46
2 changed files with 12 additions and 0 deletions
  1. +6
    -0
      README.md
  2. +6
    -0
      ubuntu/removeoldsnaps

+ 6
- 0
README.md View File

@ -1,3 +1,8 @@
---
title: distro.tools
description: Scripts for lazy Linux users
---
# distro.tools
This is a collection of shell scripts for easy management of your Linux install. The goal is to provide scripts for every possible use case from updating your system to configuring some special things. Feel free to provide your scripts.
@ -39,3 +44,4 @@ Scripts applicable on most distributions:
Scripts focused on Ubuntu and derivates:
`ubuntu/update` (sudo) - Update your Ubuntu system including Snaps and Flatpaks
`ubuntu/removeoldsnaps` (sudo) - Remove old versions of installed Snaps

+ 6
- 0
ubuntu/removeoldsnaps View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done

Loading…
Cancel
Save