Last active
September 26, 2023 06:00
-
-
Save davisokoth/a5ff0f5f192f57c420419ffe8a23a962 to your computer and use it in GitHub Desktop.
Addressing Ubuntu running out of space in root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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