Pamac command line - Failed to synchronize AUR database

There is no indication of cause.
Notably, the GUI does not give this error and seems to work fine.

Here is the output.

pamac upgrade --aur --force-refresh --no-confirm

Warning: Building packages as dynamic user
Warning: Setting build directory to /var/cache/pamac
Preparing…
Synchronizing package databases…
Refreshing core.db…
Refreshing extra.db…
Refreshing multilib.db…
Refreshing core.files…
Refreshing extra.files…
Refreshing multilib.files…
Refreshing AUR…
Failed to synchronize AUR database
Nothing to do.
Transaction successfully finished.

As there are no apparent verbose/debug options for the command and no logs, I’m unable to provide any additional debug detail.

You are running it as root, right? Don’t do that.

3 Likes

Yes, failure when run as root. Seems to work fine as user, after clearing /var/tmp/pamac. Perhaps a user warning when run as root/sudo would avoid this.

Thanks.

2 Likes

Using the Pamac CLI - Manjaro Wiki

Pamac also includes a fully functional CLI for when you don’t have a working GUI or for those that prefer to manage packages that way.

Warning

Using sudo with pamac can have undesirable effects, especially when building packages. if in doubt, don’t use sudo. Pamac will ask for escalated rights if needed.

Do you mean something like:

Warning: Do not execute pamac as root or using sudo.
You will be prompted if elevated privileges are needed.

and then the command should fail gracefully, allowing you to try again?

I think something to that extent might be beneficial for those who (for whatever reason) were unaware that sudo should not be used, or perhaps are also pacman users and typed sudo instinctively, without thinking.

Perhaps you could suggest this in the Feedback category, where it might be given fair consideration.

Cheers.

1 Like

I think something like this would do the trick. I hereby present safepamac:

#!/bin/bash

#safepamac - a script to ensure Pamac is run only as a normal user, not as root or sudo or run0

if [[ $EUID -eq 0 ]]; then

  echo -e >&2 "Warning: Do not execute pamac as root or using sudo or run0.\nPamac should only be run as a normal user\nYou will be prompted if elevated privileges are needed.\nExiting in 5 seconds..."

  sleep 5

  exit 1

fi

echo -e "Pamac is being run correctly as a normal user...\nYou will be prompted for your password if elevated privileges are required"

pamac $*

exit 0

Tested using run0, sudo, su & as a normal user:

    ~  run0                                                                                                                                        ✔ 
[scott-ser scotty]# /home/scotty/bin/safepamac search makemkv
Warning: Do not execute pamac as root or using sudo or run0.
Pamac should only be run as a normal user
You will be prompted if elevated privileges are needed.
Exiting in 5 seconds...
[scott-ser scotty]# exit
logout
    ~  sudo /home/scotty/bin/safepamac search makemkv                                                                                    1 ✘  14s  
[sudo] password for scotty: 
Warning: Do not execute pamac as root or using sudo or run0.
Pamac should only be run as a normal user
You will be prompted if elevated privileges are needed.
Exiting in 5 seconds...
    ~  su                                                                                                                                 1 ✘  8s  
Password: 
[scott-ser scotty]# /home/scotty/bin/safepamac search makemkv
Warning: Do not execute pamac as root or using sudo or run0.
Pamac should only be run as a normal user
You will be prompted if elevated privileges are needed.
Exiting in 5 seconds...
[scott-ser scotty]# exit
exit
    ~  /home/scotty/bin/safepamac search makemkv                                                                                         1 ✘  15s  
Pamac is being run correctly as a normal user...
You will be prompted for your password if elevated privileges are required
makemkv-libaacs  1:1-3                                                                                                                                  AUR
    Enable libaacs emulation from MakeMKV
makemkv-cli  1.17.8-1                                                                                                                                   AUR
    DVD and Blu-ray to MKV converter and network streamer - CLI only
makemkv  1.17.8-1                                                                                                                                       AUR
    DVD and Blu-ray to MKV converter

Of course, the ultimate aim is to have this as part of Pamac, not a separate command that feeds the arguments to Pamac if run as a normal user. But it does show that it can be done.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.