I have many programs installed, I want to keep my history, and so on and so on.. What can I do to save the situation? Thank you.
You've just found the great powers of being root and how easy it is to screw up your whole system!
I would recommend reinstalling the complete system, because, I can't agree more to what Gilles said in a similar question:
So, as this is not easy to fix yourself by hands within reasonable time and effort. And if you try, you'll notice a lot of stuff will break:
General steps for a reinstallation:
I'm looking forward to the time that we have Btrfs as the default file system and we can restore our complete system by simply reverting to a snapshot.
For changing permissions only for folders (directories), recursively, you can use:
For changing permissions only for files, recursively, you can use:
Considering you run the command with 755, you only need to run the command for the files.
Be aware that these commands run in the folder you are in (./).