Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Rep:
locate command not working properly
Hello. I have Ubuntu 16.04 on a small laptop. For some reason the locate command isn't working right. As an example, I created a text file named "test123.txt" which I put on my Desktop. I tried locate but it didn't work (see below).
Code:
mark@mark-N150-N210-N220:~$ cd Desktop
mark@mark-N150-N210-N220:~/Desktop$ ls test123.txt
test123.txt
mark@mark-N150-N210-N220:~/Desktop$ sudo updatedb
[sudo] password for mark:
mark@mark-N150-N210-N220:~/Desktop$ locate test123.txt
mark@mark-N150-N210-N220:~/Desktop$
It used to work for me in the past. I'm not sure what's wrong.
I have mlocate installed.
Last edited by mark_alfred; 09-19-2016 at 05:42 PM.
Reason: just added I have mlocate installed.
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Original Poster
Rep:
Hmm. When I set first installed Ubuntu, it asked if I wanted to either encrypt the entire computer or just the home directory or just leave it unencrypted. I didn't really know, so I chose the middle option. I'm wondering if the home directory being encrypted is causing this. It will find files in directories outside of the home directory. If this is causing it, is there a way to fix this?
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Original Poster
Rep:
I did solve this. I removed "ecryptfs" from PRUNEFS listings in the file /etc/updatedb.conf, and now locate works on my home directory as well as the rest of the computer. Hopefully that fix doesn't screw something else up. But anyway, seems locate now works.
I did solve this. I removed "ecryptfs" from PRUNEFS listings in the file /etc/updatedb.conf, and now locate works on my home directory as well as the rest of the computer. Hopefully that fix doesn't screw something else up. But anyway, seems locate now works.
That will not screw something, updatedb just records files paths in a database.
However maybe there was a reason to exclude ecryptfs, eg: to keep file listings private for encrypted directories
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Original Poster
Rep:
Thanks. Good to know.
In future when setting up a computer I likely should choose to encrypt the entire thing. I suspect it would mean I'd have to deal with an additional (and long) password to access the computer, though.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.