我最近注意到,当我运行它时,locate [something]
它总是会失败,即使我知道文件在那里(并且我之前已经通过调用看到它们)。每次我想找到某个东西时,locate
我都必须先运行。updatedb
这似乎是最近才发生的事情,过去从未出现过问题。很难确切地说出它何时删除了数据库,但可能是在重新启动后。
这是正常/预期的行为吗?或者我遇到了一些奇怪的事情?
预期的:
sudo updatedb
locate file.c [success]
reboot #I think this is the trigger
locate file.c [success]
实际行为:
sudo updatedb
locate file.c [success]
reboot #I think this is the trigger
locate file.c [fail]
sudo updatedb
locate file.c [success]
編輯
这是带有 4.16.8 内核的 Ubuntu 16.04。
locate --version
返回locate (GNU findutils) 4.7.0-git
updatedb --version
也返回4.7.0-git
然而
apt show findutils 不同意版本(手动安装 - 我确实安装了这个,但我没有安装任何特定版本)
Package: findutils
Version: 4.6.0+git+20160126-2
Priority: required
Essential: yes
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Andreas Metzler <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 573 kB
Pre-Depends: libc6 (>= 2.17), libselinux1 (>= 1.32)
Suggests: mlocate | locate
Conflicts: debconf (<< 1.5.50)
Breaks: binstats (<< 1.08-8.1), debhelper (<< 9.20130504), guilt (<< 0.36-0.2), kernel-package (<< 13.000), libpython3.4-minimal (<< 3.4.4-2), libpython3.5-minimal (<< 3.5.1-3), lsat (<< 0.9.7.1-2.1), mc (<< 3:4.8.11-1), sendmail (<< 8.14.4-5), switchconf (<< 0.0.9-2.1)
Homepage: http://savannah.gnu.org/projects/findutils/
Task: minimal
Supported: 5y
Download-Size: 280 kB
APT-Manual-Installed: yes
APT-Sources: http://repo.bblabs/ubuntu xenial/main amd64 Packages
Description: utilities for finding files--find, xargs
GNU findutils provides utilities to find files meeting specified criteria and perform various actions on the files which are found. This package contains 'find' and 'xargs'; however, 'locate' has been split off into a separate package.