LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2011, 11:51 AM   #1
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Rep: Reputation: Disabled
Locate Does Not Work


I saved my file as antennaproposal.doc but when I use the command "locate antenna" or "locate antennaproposal" I cannot find my file. Why?
 
Old 09-12-2011, 11:55 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
The locate command depends on a database of files on the disk. You must run the updatedb command to update the database before it will show any new files.
 
1 members found this post helpful.
Old 09-16-2011, 12:07 AM   #3
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
c@c-laptop:~/bash_folder$ updatedb

updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'


Something is wrong...
 
Old 09-16-2011, 12:09 AM   #4
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Debian
Posts: 794

Rep: Reputation: 56
Run updatedb as root. Since you're in Ubuntu that would be:

Code:
sudo updatedb
Edit: Updatedb has a record of all files on the hard drive, many of which normal users don't have access to, so it has to be executed with root privileges.
 
Old 09-16-2011, 12:26 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
See if there is a /var/lib/mlocate/tmp/ directory. If so what are the permissions? Maybe you need to run updatedb as root.

The updatedb program is usually run daily in the wee hours.

Another thing to check is if your disks are low on space. That could prevent creating a temporary file in /tmp/ or /var/tmp/.
 
Old 09-16-2011, 06:42 AM   #6
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
Help! something is wrong!

c@c-laptop:/var/lib/mlocate$ cd tmp
bash: cd: tmp: No such file or directory


err.. sudo updatedb works but it takes an awful long time.
 
Old 09-16-2011, 07:15 AM   #7
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
Originally Posted by hitmen View Post
Help! something is wrong!

c@c-laptop:/var/lib/mlocate$ cd tmp
bash: cd: tmp: No such file or directory


err.. sudo updatedb works but it takes an awful long time.
No problem, Hitmen. I don't have /var/lib/mlocate/tmp either. The only file or folder in /var/lib/mlocate/ is mlocate.db
It's normal for it to take a long time if this is the first time you did it or if you haven't undated it for a long time. Not to worry.
ciao,
jdk
 
  


Reply



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
cpan> locate -u Unknown shell command 'locate -u'. Type ? for help. sharad2005 Linux From Scratch 1 08-04-2006 12:40 AM
updatedb / locate doesn't appear to work allelopath Linux - Software 5 08-28-2005 10:55 PM
can't locate module scanner > how to get scanner work? b0uncer Linux - Hardware 1 10-26-2003 06:50 AM
Locate command does not work waffe Linux - General 2 09-26-2003 09:54 PM
locate doesn't work jamaso Slackware 2 07-29-2002 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:43 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