In the wiki for How to install Kodi on Linux the uninstall instructions in section 1.6 says:
Then remove the settings folder to remove all settings and library data. This will not delete any videos or music, but just the settings and library data itself:
When I tried this the terminal replied "cannot do this to a directory". Google says that command only works if the directory is empty and to use the following command which did work for me. So, either I've screwed up my system or the wiki could be updated?
rm -r ~/.kodi/