LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-19-2016, 05:34 PM   #1
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 209Reputation: 209Reputation: 209
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.
 
Old 09-19-2016, 06:55 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
check your /etc/updatedb.conf config file, see if your directory is not excluded in PRUNEPATHS, or filesystem in PRUNEFS
 
1 members found this post helpful.
Old 09-19-2016, 07:09 PM   #3
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 209Reputation: 209Reputation: 209
Here's what the file says,
Code:
PRUNE_BIND_MOUNTS="yes"
# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs /var/lib/schroot"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ecryptfs fusesmb devtmpfs"
I'm not sure if this means my directory is excluded or not.

The file /home/.ecryptfs is a link to /home/.ecryptfs/mark/.ecryptfs.

Last edited by mark_alfred; 09-19-2016 at 07:10 PM. Reason: corrected a typo
 
Old 09-19-2016, 07:18 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,920

Rep: Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305
redacted... totally unrelated.

Last edited by michaelk; 09-19-2016 at 07:37 PM.
 
Old 09-19-2016, 07:25 PM   #5
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 209Reputation: 209Reputation: 209
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?
 
Old 09-19-2016, 07:36 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,920

Rep: Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305Reputation: 4305
Totally off the mark here, was not paying enough attention...

Yep, makes sense it isn't included since it is in prunepaths and prunefs

Last edited by michaelk; 09-19-2016 at 07:59 PM.
 
Old 09-19-2016, 07:51 PM   #7
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 209Reputation: 209Reputation: 209
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.
 
Old 09-20-2016, 04:15 AM   #8
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by mark_alfred View Post
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
 
1 members found this post helpful.
Old 09-21-2016, 09:01 AM   #9
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 209Reputation: 209Reputation: 209
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.
 
  


Reply

Tags
command line, locate, ubuntu, updatedb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] OSX - command not working properly Predatorian Linux - General 1 04-28-2013 05:46 AM
usermod command not working properly ! noony123 Linux - Newbie 8 03-23-2011 06:16 AM
[SOLVED] locate command not working for me nnjond Linux - Newbie 6 10-06-2010 01:35 AM
why locate command is not working? sathyguy Linux - Enterprise 2 07-29-2007 09:32 AM
Autostart command not working properly dstjames Linux - Newbie 2 01-10-2006 02:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration