locate cannot find file on parrot 6.0

┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $ls
Dvwa.txt

┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $sudo updatedb
[sudo] password for parrot:
┌─[parrot@parrot]─[~/Documents/tes]
└──╼ $locate Dvwa.txt

I want to find the location of Dvwa.txt file using locate, after I do sudo updatedb and do a search with the command “locate Dvwa.txt” nothing comes up, how do I solve it ??

Hi @Xnone

Maybe delete the /var/cache/locate/locatedb file and rebuild?

┌─[masmer@cracker]─[~]
└──╼ $touch Dvwa.txt
┌─[masmer@cracker]─[~]
└──╼ $ls
Desktop    Downloads  Music     Public     Videos
Documents  Dvwa.txt   Pictures  Templates
┌─[masmer@cracker]─[~]
└──╼ $sudo updatedb
/usr/bin/find: '/run/user/1000/doc': Permission denied
/usr/bin/find: '/run/user/1000/gvfs': Permission denied
┌─[masmer@cracker]─[~]
└──╼ $locate Dvwa.txt
/home/masmer/Dvwa.txt
┌─[root@parrot]─[/home/parrot]
└──╼ #ls /var/cache/locate/locatedb
ls: cannot access '/var/cache/locate/locatedb': No such file or directory

file /var/cache/locate/locatedb doesn’t exist. I installed locate with apt install mlocate

/var/lib/plocate/plocate.db

┌─[user@parrot]─[~]
└──╼ $sudo apt install mlocate
┌─[user@parrot]─[~]
└──╼ $touch mytext.txt
┌─[user@parrot]─[~]
└──╼ $locate mytext.txt 
/var/lib/plocate/plocate.db: No such file or directory
┌─[✗]─[user@parrot]─[~]
└──╼ $sudo updatedb
┌─[user@parrot]─[~]
└──╼ $locate mytext.txt 
/home/user/mytext.txt