[solved] Problems to get locate

Hello,
I am trying to get ‘locate’ but it seems that I am missing something to do, if someone could please tell me what my error is … Thanks.

[alnone@alnone-inspiron3583 ~]$ locate octopi
pread: Short read (file corrupted?)
[alnone@alnone-inspiron3583 ~]$ locate google-chrome
pread: Short read (file corrupted?)
[alnone@alnone-inspiron3583 ~]$ locate focuswriter
pread: Short read (file corrupted?)
[alnone@alnone-inspiron3583 ~]$ LANG=C sudo pacman -S locate
[sudo] password for alnone: 
warning: plocate-1.1.22-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Package (1)    Old Version  New Version  Net Change

extra/plocate  1.1.22-1     1.1.22-1       0.00 MiB

Total Installed Size:  0.51 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [------------------------] 100%
(1/1) checking package integrity                   [------------------------] 100%
(1/1) loading package files                        [------------------------] 100%
(1/1) checking for file conflicts                  [------------------------] 100%
:: Processing package changes...
(1/1) reinstalling plocate                         [------------------------] 100%
:: Running post-transaction hooks...
(1/5) Creating system user accounts...
(2/5) Reloading system manager configuration...
(3/5) Creating temporary files...
(4/5) Arming ConditionNeedsUpdate...
(5/5) Checking which packages need to be rebuilt
[alnone@alnone-inspiron3583 ~]$ locate focuswriter
pread: Short read (file corrupted?)
[alnone@alnone-inspiron3583 ~]$
[alnone@alnone-inspiron3583 ~]$ inxi -Fxxx
System:
  Host: alnone-inspiron3583 Kernel: 6.8.1-arch1-1 arch: x86_64 bits: 64
    compiler: gcc v: 13.2.1 clocksource: tsc
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 wm: xfwm4 v: 4.18.0
    with: xfce4-panel tools: xfce4-screensaver vt: 7 dm: LightDM v: 1.32.0
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: Dell product: Inspiron 3583 v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Dell model: 0WHCP7 v: A00 serial: <superuser required> part-nu: 08CA
    uuid: <superuser required> UEFI: Dell v: 1.5.1 date: 05/30/2019
Battery:
  ID-1: BAT0 charge: 39.9 Wh (100.0%) condition: 39.9/42.0 Wh (95.0%)
    volts: 12.7 min: 11.4 model: SMP DELL VM73283 type: Li-poly serial: 18736
    status: full
CPU:
  Info: quad core model: Intel Core i5-8265U bits: 64 type: MT MCP
    smt: enabled arch: Comet/Whiskey Lake note: check rev: C cache: L1: 256 KiB
    L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 450 high: 800 min/max: 400/3900 cores: 1: 800 2: 400
    3: 400 4: 400 5: 400 6: 400 7: 400 8: 400 bogomips: 28808
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Dell
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: HDMI-A-1
    bus-ID: 00:02.0 chip-ID: 8086:3ea0 class-ID: 0300
  Device-2: Realtek Integrated_Webcam_HD driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 bus-ID: 1-6:3 chip-ID: 0bda:5520 class-ID: 0e02
    serial: 200901010001
  Display: x11 server: X.Org v: 21.1.11 compositor: xfwm4 v: 4.18.0 driver:
    X: loaded: modesetting alternate: fbdev,intel,vesa dri: iris gpu: i915
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99")
    s-diag: 414mm (16.31")
  Monitor-1: eDP-1 model: AU Optronics 0x10ec res: 1366x768 hz: 60 dpi: 101
    size: 344x193mm (13.54x7.6") diag: 394mm (15.5") modes: 1366x768
  API: EGL v: 1.5 hw: drv: intel iris platforms: device: 0 drv: iris
    device: 1 drv: swrast surfaceless: drv: iris x11: drv: iris
    inactive: gbm,wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.0.3-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics 620 (WHL
    GT2) device-ID: 8086:3ea0
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Dell
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:9dc8
    class-ID: 0403
  API: ALSA v: k6.8.1-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.0.4 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL810xE PCI Express Fast Ethernet vendor: Dell
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000
    bus-ID: 01:00.0 chip-ID: 10ec:8136 class-ID: 0200
  IF: enp1s0 state: up speed: 100 Mbps duplex: full mac: d8:d0:90:46:9d:0f
Drives:
  Local Storage: total: 238.47 GiB used: 8.97 GiB (3.8%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN520 NVMe WDC 256GB
    size: 238.47 GiB speed: 15.8 Gb/s lanes: 2 tech: SSD serial: 191939446503
    fw-rev: 20200012 temp: 44.9 C scheme: GPT
Partition:
  ID-1: / size: 41.9 GiB used: 8.78 GiB (21.0%) fs: ext4 dev: /dev/nvme0n1p7
  ID-2: /boot/efi size: 1.43 GiB used: 191.9 MiB (13.1%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 1.42 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p2
Sensors:
  System Temperatures: cpu: 37.0 C pch: 35.0 C mobo: 32.0 C
  Fan Speeds (rpm): cpu: 0
Info:
  Memory: total: 8 GiB available: 7.63 GiB used: 1.68 GiB (22.1%)
  Processes: 226 Power: uptime: 25m states: freeze,mem,disk suspend: deep
    wakeups: 0 hibernate: platform Init: systemd v: 255 default: graphical
  Packages: pm: pacman pkgs: 919 Compilers: gcc: 13.2.1 Shell: Bash
    v: 5.2.26 running-in: xfce4-terminal inxi: 3.3.33
[alnone@alnone-inspiron3583 ~]$

I was in a hurry … and I didn’t search well… sorry:

[alnone@alnone-inspiron3583 ~]$ updatedb
/var/lib/plocate/: Permission denied
[alnone@alnone-inspiron3583 ~]$ sudo -i
[root@alnone-inspiron3583 ~]# updatedb
[root@alnone-inspiron3583 ~]# locate octopi
/home/alnone/.config/octopi
/home/alnone/.config/octopi/octopi.conf
/usr/bin/octopi
/usr/bin/octopi-cachecleaner
/usr/bin/octopi-repoeditor
/usr/include/alpm_octopi_utils.h

Shouldn’t there be a systemd service that runs updatedb based on a timer? If you’ve enabled that service, you shouldn’t have to manually update plocate’s database.

What is the output of

$ systemctl status plocate-updated.timer