Problem
I was trying to have the yum cache on a lustre mount so it could be shared amongst several machines to save on external bandwidth, but got the message that
_sqlite.OperationalError: database is locked
It also happens with an nfs mounted directory.
Solution
For lustre solution was to mount with localflock, for nfs the solutions is to make sure the nfslock service is running.