Clear the apt package cache: This removes downloaded package files that are no longer needed.
sudo apt clean
Remove unused packages: This command removes packages that were automatically installed to satisfy dependencies for other packages but are no longer needed.
sudo apt autoremove
Clean up outdated packages: This is similar to autoremove but also removes older versions of packages that are no longer installable.
sudo apt autoclean
Check current journal size: Before deleting, check how much space the journal logs are using.
sudo journalctl --disk-usage
Vacuum journal logs: These commands reduce the size of the journal logs. To delete logs older than a specific time:
sudo journalctl --vacuum-time=2days
To delete logs until the total size is below a certain amount:
sudo journalctl --vacuum-size=100M