You are not logged in.
Whenever I install a package that edits my MIME database the pacman command always fails with the message "error: command failed to execute correctly" I have tried running pacman with --debug to see if there is anymore information but that is the only error message I get. Additionally trying to run update-desktop-database results in the error "The databases in [$HOME/.local/share/applications] could not be updated."
I am not sure what to do to troubleshoot this at this point, given how vague the errors have been. The directory exists and contains a few different files, that as far as I can tell are correct.
Last edited by trout420 (2023-05-28 19:36:09)
Offline
I have tried running pacman with --debug to see if there is anymore information but that is the only error message I get.
You could override the pacman hook /usr/share/libalpm/hooks/update-desktop-database.hook by copying it to /etc/pacman.d/hooks in in the override change --quiet to --verbose.
Additionally trying to run update-desktop-database results in the error "The databases in [$HOME/.local/share/applications] could not be updated."
Hooks are executed as root rather than your user.
Offline
You could override the pacman hook /usr/share/libalpm/hooks/update-desktop-database.hook by copying it to /etc/pacman.d/hooks in in the override change --quiet to --verbose.
after overriding the hook the verbose error I get is very similar to the output of update-desktop-database
Search path is now: [$HOME/.local/share/applications]
Could not create cache file in "$HOME/.local/share/applications": Error opening directory ?$HOME/.local/share/applications?: No such file or directory
The databases in [$HOME/.local/share/applications] could not be updated.
error: command failed to execute correctly
Given that the hook is ran as root, I am not exactly sure what that path should expand to, if "sudo echo $HOME" is to be trusted it still refers to my local desktop database, which does indeed exist.
Offline
loqs wrote:You could override the pacman hook /usr/share/libalpm/hooks/update-desktop-database.hook by copying it to /etc/pacman.d/hooks in in the override change --quiet to --verbose.
after overriding the hook the verbose error I get is very similar to the output of update-desktop-database
That is the output from pacman after installing/updating/removing a package triggers the hook? Is $XDG_DATA_DIRS set for either your user or root?
Edit:
I am guessing you have the equivalent of XDG_DATA_DIRS='$HOME/.local/share/' set somewhere.
Last edited by loqs (2023-05-28 18:46:18)
Offline
yes this output was generated after running
pacman -S pavucontrol
.
$XDG_DATA_DIRS is set to $HOME/.local/share in my /etc/environment
Last edited by trout420 (2023-05-28 19:10:03)
Offline
$XDG_DATA_DIRS is set to $HOME/.local/share for my user.
Where and how is that set. Whatever is doing it is not expanding $HOME. Is it also set for root?
Offline
sorry, just updated my previous post with where it is set
Offline
/etc/environment:
XDG_DATA_DIRS="$HOME/.local/share"
Offline
See https://man.archlinux.org/man/core/pam/pam_env.8.en as far as I can tell /etc/environment does not support variable expansion.
Offline
ah, that was the issue, moved the declaration to my .zshrc and it is working now.
Thank you!
Offline