After upgrading to Big Sur, none of the System Preferences panes open. A little hunting around online steered me to the folder, Library/PreferencePanes, which is now completely empty. So I guess there's just nothing to open. On the advice of Apple Support, I've tried reinstalling Big Sur in the hope that it would restore everything, but still nothing. The folder remains empty. I've tried multiple restarts and clearing NVRAM. Weirdly, when I open Timemachine and search for old copies of Library/PreferencePanes to restore, the folder is empty even before the upgrade, back in the good old days when the panes still opened. I'm stuck. Any ideas would be great. Thanks!
Make sure you look at the right preference panes folder. There are three of them:
/System/Library/PreferencePanesThis folder includes all the panes which are shipped with macOS. It definitely should not be empty.
/Library/PreferencePanesHere you can install third-party panes which should be available for all users of your Mac.
/Users/yourusername/Library/PreferencePanesHere you can install third-party panes which should be available just for "your" user.
Use Finder and select "Go to" – "Go to folder..." and enter one of the path names. Finder will then show you wether it is empty. The last two can be empty, but the first one not.
If the first one isn't empty, try to add another admin user using the steps in this answer and see if this user can open the preference panes.
If it is empty, you should try to install the system again, checking the disk first by booting into recovery mode. Press
Command-R during startup to do this.