Skip to content

Instantly share code, notes, and snippets.

@cuckookernel
Last active January 17, 2022 19:51
Show Gist options
  • Save cuckookernel/b99cb02cec3b00d04f0a42d99267af8e to your computer and use it in GitHub Desktop.
Save cuckookernel/b99cb02cec3b00d04f0a42d99267af8e to your computer and use it in GitHub Desktop.
# remove unsused packages
sudo apt-get autoremove
# clean APT cache
sudo apt-get clean
# clean oldish journal logs
sudo journalctl --vacuum-time=1d
# remove old versions of snap packages
echo "
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print \$1, \$3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
" >> ./remove_snaps.sh
chmod a+x remove_snaps.sh
sudo ./remove_snaps.sh
# clean thumbnail cache
rm -rf ~/.cache/thumbnails/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment