How can I safely clean the system from unnecessary files to free up disk space? I mean unnecessary packages, configs, cache, etc.
Remove packages that were automatically installed to satisfy dependencies for some package and that are no more needed:
sudo apt-get autoremove
Clear out the local repository of retrieved package files:
sudo apt-get clean
Remove all files associated with removed packages (if you don’t have aptitude installed do
sudo apt-get install aptitude):
sudo aptitude purge ~c
Remove old kernel versions (thank @waldyrious for this answer):
sudo apt-get purge $( dpkg --list | grep -P -o "linux-(headers|image)-\d\S+" | grep -v $(uname -r | grep -P -o ".+\d") )
Clear the thumbnail cache:
rm -v -f ~/.cache/thumbnails/*/*.png ~/.thumbnails/*/*.png
Linux remove unuseful files automaticly way more than windows. An app like CCleaner for windows will not have much work and it is unuseful I think.
It can still detect a very few mistakes, remove the data of your programs (reset them, useful especially if you have got chrome wich stores about 2 GB on my computer even if I am nearly not using it), and see if you have got the same file 2 times at a different place.
You have a few equivalents including bleachbit (supposed to be the best, haven't tried it), you can also use SystemCleanUpTool, fslint and GTKOrphan.
Use Resetter app from This site https://github.com/gaining/Resetter