You need to have the metadata.db owned and writable by your user. You also need the entre calibre library folder that is with the metadata.db file owned and writable by your user.
Something like this will work:
Code:
$ sudo chown -R your_user library_folder
$ sudo chmod -R 744 library_folder