How do I reduce the size of mlocate database?

20,527

The /var/lib/mlocate/mlocate.db.?????? files are leftover temporary files from a (probably) interrupted updatedb run. They don't appear on either of my Ubuntu 11.10 systems, except when updatedb is running. Delete them:

sudo rm -f /var/lib/mlocate/mlocate.db.??????

then, to be sure, run

sudo /etc/cron.daily/mlocate
Share:
20,527

Related videos on Youtube

MountainX
Author by

MountainX

You may be interested in the story of SE moderator Monica Cellio and how she was unfairly treated by the corporate management of this site. More info here. An update is available. Let's hope we can cultivate a more fair environment for content creators and moderators going forward.

Updated on September 18, 2022

Comments

  • MountainX
    MountainX over 1 year

    I'm out of space on /var

      25G   25G     0 100% /var
    

    It looks like mlocate.db is the problem:

    # find /var -printf '%s %p\n' | sort -nr | head
    13140140032 ./lib/mlocate/mlocate.db.cgLMAM
    12409839616 ./lib/mlocate/mlocate.db.MqGeqe
    
    # cat /etc/updatedb.conf
    PRUNE_BIND_MOUNTS="yes"
    PRUNENAMES=".git .bzr .hg .svn"
    PRUNEPATHS="/tmp /var/spool /media"
    PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf"
    

    I don't see anything else to prune. So how can I fix this? Thanks

    • rubo77
      rubo77 about 10 years
      WOW! that is more than 10GB each!
  • northern-bradley
    northern-bradley almost 8 years
    thank you. i was debating whether or not to delete the 900+MB file mlocate.db.pm5NNC that was time stamped dec 2015. with your answer i took the plunge!
  • northern-bradley
    northern-bradley almost 8 years
    clearly my nearly 1GB file was a little one and i've got off lightly: ubuntuforums.org/showthread.php?t=1487312