[FAILED] failed to start pkgfile database update

maybe it is because I use oh-my-zsh as default terminal

I dont think so … that would be a very odd depend for zsh or zsh theming, etc.
Why not run one of the commands I provided so we can see if anything relies on it ?

EDIT.
Oh … I see your edit above contains more info.

huh. your zsh config seems to be acting funny if the grep didnt work.
In any case … yeah I saw your edit above , its not ‘oh-my-zsh’ … but it is from manjaro-zsh-config.
No idea why… oh so I looked into it.


It appears its a dep for one single function of “command-not-found.zsh”.
A whole package and a service and a timer for one action? Not something I would do.
But unless you want to modify that package or remove it … seems you are stuck with pkgfile.

In that case … you might want to manually initiate a pkgfile refresh:

sudo pkgfile -u
3 Likes
(base) [11:02:04] firestar:~ $ sudo pkgfile -u         
:: Updating 4 repos...
  core is up to date
  extra is up to date
  community is up to date
  multilib is up to date

yes it is just like sudo pacman -Syyu

And on a restart do you see the same error?

I noticed that pkgfile service will lock the db from time to time. Maybe we can ping @Chrysostomus to have a look at it. :slight_smile:

It is used be manjaro-zsh-config for command not found hook. Pamac and pacman have similar functionality, but pkgfile has significantly better performance. You don’t want to have your terminal stuck for several seconds when you type in a nonexistent command. With pkgfile the results are practically instant. And for this it needs to update the files database from from time to time. The service does this in the background.

1 Like

No, it is not.

when I closed my computer there still was, but when I open it again it did not show the same error

i have same issue from a fresh install of manjaro (KDE edition), i didnt even know manjaro comes with zsh. but it seems its pre installed.

can i safely remove manjaro-zsh-config? or zsh entirely? i dont want a service to be running in the backround when i dont even use zsh

If you are using bash or fish instead, then yes, you can remove it without any issues. Only gnome edition comes with zsh enabled by default.

thanks, this is the command i used

sudo pacman -Rsu manjaro-zsh-config zsh-autosuggestions zsh-completions zsh-history-substring-search zsh-syntax-highlighting zsh

seems to work fine :smiley:

How to auto-update pkgfile and do not see this warning again? Can I use .desktop file to solve this?

.desktop file does not work!

Let us try the solution below by @ThalesMarcel

I believe that I found the solution to this problem.
I realized through this forum question that pkgfile-update.service was not running on my computer, although pkgfile-update.timer seems to be active.

These files are located in /lib/systemd/system/

I started researching the configuration of systemd service files, which led me to a question on an Arch Linux forum (unfortunately, as a newly registered member, I cannot link to it here). There I found that every .service file has a [Install] section, where the service execution targets are defined. And that section was missing from my pkgfile-update.service file. In addition, in the [Unit] section, at the end of the After and Wants lines, I added systemd-user-sessions.service , so that all user processes logged on the system are closed without generating new errors.

So, for me, the solution was to include the following content at the end of the file:

nano /lib/systemd/system/pkgfile-update.service

[Install]
WantedBy = poweroff.target reboot.target

With these lines, the service runs every time the system is shut down or restarted. So far, the error message has stopped appearing before the system shutdown.

This is the complete file, with the changes made:

nano /lib/systemd/system/pkgfile-update.service 

[Unit]
Description=pkgfile database update
RequiresMountsFor="/var/cache/pkgfile"
After=network-online.target systemd-user-sessions.service
Wants=network-online.target systemd-user-sessions.service

[Service]
Type=oneshot
ExecStart=/usr/bin/pkgfile -u
Nice=19
StandardOutput=null
StandardError=journal
PrivateTmp=yes
PrivateDevices=yes
CapabilityBoundingSet=
NoNewPrivileges=yes

[Install]
WantedBy=poweroff.target reboot.target

I hope this helps everyone who uses the zsh shell and is experiencing this problem.
And I’m sorry for any typos. I am Brazilian and do not have much knowledge of English.

7 Likes

I’ve got the same problem with Manjaro 20.2-rc1 Kde version. Thanks to ThalesMarcel, I will try his solution. :wink:

It seems that this does not work either.

The message appears again this morning.

It works but now I’ve got another message error: “Failed to start Apply Kernel Variables” on Manjaro KDE 20.2-rc1.

Note: Ok, I see the error on the net. I must check Cache parameter line in sysctl.conf file. It must be commented. Or perhaps another element in this file. I will check it later.

sudo systemctl status pkgfile-update.timer
sudo systemctl status pkgfile-update.service

sudo systemctl enable pkgfile-update.timer
sudo systemctl enable pkgfile-update.service

2 Likes

I have had this problem too for a while, on a recent KDE install.

For me it was a mirror problem, switching mirror solved it for me.

[patrik@xps ~]$ sudo systemctl status pkgfile-update.service
● pkgfile-update.service - pkgfile database update
     Loaded: loaded (/usr/lib/systemd/system/pkgfile-update.service; static)
     Active: failed (Result: exit-code) since Sat 2020-12-19 15:32:11 CET; 10min ago
TriggeredBy: ● pkgfile-update.timer
    Process: 1137 ExecStart=/usr/bin/pkgfile -u (code=exited, status=1/FAILURE)
   Main PID: 1137 (code=exited, status=1/FAILURE)

dec 19 15:32:11 xps pkgfile[1137]: error: failed to update repo: community
dec 19 15:32:11 xps pkgfile[1137]: warning: download failed: https://ftp.lysator.liu.se/pub/manjaro/stable/core/x86_64/core.files: Could not resolve host: ftp.lysator.liu.se
dec 19 15:32:11 xps pkgfile[1137]: error: failed to update repo: core
dec 19 15:32:11 xps pkgfile[1137]: warning: download failed: https://ftp.lysator.liu.se/pub/manjaro/stable/extra/x86_64/extra.files: Could not resolve host: ftp.lysator.liu.se
dec 19 15:32:11 xps pkgfile[1137]: error: failed to update repo: extra
dec 19 15:32:11 xps pkgfile[1137]: warning: download failed: https://ftp.lysator.liu.se/pub/manjaro/stable/multilib/x86_64/multilib.files: Could not resolve host: ftp.lysator.liu.se
dec 19 15:32:11 xps pkgfile[1137]: error: failed to update repo: multilib
dec 19 15:32:11 xps systemd[1]: pkgfile-update.service: Main process exited, code=exited, status=1/FAILURE
dec 19 15:32:11 xps systemd[1]: pkgfile-update.service: Failed with result 'exit-code'.
dec 19 15:32:11 xps systemd[1]: Failed to start pkgfile database update.
[patrik@xps ~]$ sudo systemctl start pkgfile-update.service
[patrik@xps ~]$ sudo systemctl status pkgfile-update.service
● pkgfile-update.service - pkgfile database update
     Loaded: loaded (/usr/lib/systemd/system/pkgfile-update.service; static)
     Active: inactive (dead) since Sat 2020-12-19 15:43:22 CET; 2s ago
TriggeredBy: ● pkgfile-update.timer
    Process: 3760 ExecStart=/usr/bin/pkgfile -u (code=exited, status=0/SUCCESS)
   Main PID: 3760 (code=exited, status=0/SUCCESS)

dec 19 15:43:10 xps systemd[1]: Starting pkgfile database update...
dec 19 15:43:22 xps systemd[1]: pkgfile-update.service: Succeeded.
dec 19 15:43:22 xps systemd[1]: Finished pkgfile database update.