Why "locate" finds leftover Clamav, Nautilus doesn't

Discussion in 'all things UNIX' started by Judge Dee, Jun 19, 2009.

Thread Status:
Not open for further replies.
  1. Judge Dee
    Offline

    Judge Dee Guest

    I uninstalled Clamav using Synaptic, and "locate clam" in a terminal found a lot of leftover files. Using Nautilus as root, I located most of them, but not all. The "rm" command also doesn't locate them. Why does "locate" continue to list these files?
    edit: Ubuntu 9.04

    Regards,
    Last edited by a moderator: Jun 19, 2009
  2. Pedro
    Offline

    Pedro Registered Member

    Run updatedb as root. In Ubuntu that's sudo updatedb.
  3. Judge Dee
    Offline

    Judge Dee Guest

    Pedro, it cleared the references.
    My thanks. :)
    What is the reason?
  4. LowWaterMark
    Offline

    LowWaterMark Administrator

    locate uses a stored database of file system contents for the purpose of providing very fast responses to requests. It doesn't scan the directories real-time when you issue a locate command. The updatedb command refreshes that database. So, when you add or remove any file(s), locate will not reflect those change(s) until the next updatedb is executed.

    Servers usually have a cron job, running perhaps once daily, to execute the updatedb automatically.
  5. Judge Dee
    Offline

    Judge Dee Guest

    Another mystery - for me - cleared up. Thanks, LWM.

    Regards,
  6. Pedro
    Offline

    Pedro Registered Member

    Sorry if i sounded rather cryptic, i was kind of rushing it. (not you, just the computer!)

    Anyway LWM explained it better than i would.
    You can also read the manual pages on locate and updatedb with man updatedb and man locate where their purpose and usage are explained (q to exit).
  7. Judge Dee
    Offline

    Judge Dee Guest

    Hey, no problem, Pedro. You solved the main issue for me.
    Thanks for the manuals. Going to read them now.

    Regards,
Thread Status:
Not open for further replies.