Permission Denied for apropos command
I'm not sure how to do what you are asking.  Looking into that now, but I know how to get around the permissions problems you are having with sudo.

Your syntax is wrong for sudo, the shell redirection ">" is happening without elevated privelleges.  Try wrapping in quotes like this:

sudo -s 'apropos . &gt; touch thedatabase'