Skip to content

Instantly share code, notes, and snippets.

@davisokoth
Last active September 26, 2023 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davisokoth/a5ff0f5f192f57c420419ffe8a23a962 to your computer and use it in GitHub Desktop.
Save davisokoth/a5ff0f5f192f57c420419ffe8a23a962 to your computer and use it in GitHub Desktop.
Addressing Ubuntu running out of space in root
#
# Copied from https://forums.linuxmint.com/viewtopic.php?t=338648
sudo apt autoclean
sudo apt autoremove --purge
sudo find /tmp -type f -delete
dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge
rm -v -f ~/.cache/thumbnails/*/*.png ~/.thumbnails/*/*.png
# This next command failed for me
# sudo journalctl --vacuum-time=1s
sudo journalctl --rotate
sudo journalctl --vacuum-time=1s
# Restart system
# I later ran this after restart and whooops!
# Found that docker was the source of maybe all my problems
sudo du -hs /var/lib/* |sort -h
# I had some old docker containers that I no longer needed. Pruning was not working because they were running
# I did not need any docker containers running so I could stop and delete indiscriminately
docker kill $(docker ps -q) # kills all running containers
docker rm $(docker ps -a -q) # Deletes all stopped containers
docker rmi $(docker images -q) # Delete all images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment