I followed this answer to the question of removing Ubuntu documentation to save space. While the method worked, it has rendered my system somewhat broken. Every now and then when I install some package, it depends on some folder in the documentation existing. Two such apps are:
- Virtual Box (error during run -- had to create /usr/share/doc/virtualbox)
- PostgreSQL (error during installation -- had to create /usr/share/man/man7)
EDIT
It took a lot of digging (around 2 days) to find solution to 1. Unfortunately, there was no way to find out which directory was the issue, or even that the existence of the directory was the issue. Fortunately, after 2 days, just before I was about to do a clean install, I came across this post that hinted that removing the documentation could be the problem.
So the solution is not just to "recreate the folder", as one of the comment says, but to find out which folder(s) to recreate, which is not so easy.
2 was easier due to the error printed on console.
For now I would like to get my system back to the "unbroken" stage without having to do a complete reinstall. What is the best way to get documentation back?
The easiest way to regenerate any package-provided file, including documentation, is to reinstall the package.
However, sometimes documentation is provided by a different package:
If you are unsure which package provided a file, it's easy to look up:
And one tip: The package manager (apt/dpkg) cares about the presence of a file. Never manually remove a file placed by apt/dpkg. However, apt/dpkg cares not a whit for the content of that file. If you really wish, you can easily replace large doc files with tiny dummy files (at your own risk, of course).
The 'du' command is very useful to determine if the space savings are worthwhile. Undo the substitution by reinstalling the package.