Pamac Auth fails

When you get authentication errors it is usually because the polkit daemon is not running.

I ran a test - out of curiosity - to see if I could reproduce - but I can’t.

On i3 you need to specifically ensure a polkit agent is loaded via your i3.conf.

Yes you need polkit daemon running AND a polkit authentication agent
https://wiki.archlinux.org/index.php/Polkit#Authentication_agents

You are right, starting the gnome agent does work. Is there a way to change this to a more shell-friendly way or avoid polkit and use password prompt on the commandline? I tried the pkttyagent, but it doesn’t seem to work. I don’t know polkit, so I’m unsure what to do.

I would recommend to configure your DE to start an authentication agent at session startup because it can be needed by other apps.
Otherwise you can use sudo and build as root with Pamac 10. You will find your build files in /var/cache/pamac.

disadvantage of using sudo for pamac is that pamac will build aur packages with root privileges. Something it warns you against and is not considered best practice. I’ve never needed polkit before although I’ve run without a DE for years. But I’m willing to use polkit. Just hoped it could give me a prompt in the shell in stead of popping up a window. On the XFCE version, with the dropdown terminal, the terminal disappears when focussing on the polkit window. Mightily irritating.
Not complaining though, on the other hand, it’s usable now. If it irritates to much, I can always go to pacman and yay for package management. So thanks for the help and info.

still can’t figure out the issue; i understand that pamac is looking for a polkit agent for authentication. however just quitting without a proper error (just with Authentication failed) seems to be incomplete…

it seems, pamac works from linux tty/console - it asks properly for authentication for org.manjaro.pamac.commit - even when there are no running polkit agents.

i encounter the issue when i’m using sway on wayland.
@guinux no the pamac-manager doesn’t work either, and i get that GUI applications require an agent that shows a GUI dialog.

it seems “kinda” work when polkit-gnome-authentication-agent-1 is started, then it asks for the password on a new GUI dialog. why it doesn’t ask in the terminal window where i’m in?
also running pkttyagent doesn’t seem to work under wayland.

does the wayland terminal miss an environment variable? so that the terminal can interact with it? or through systemctl environment? or do i have to enter the password from now on always in GUI? why the sudden change on pamac?

basically the question is, on the terminal why systemctl restart polkit is able to authenticate me but not pamac install wev when both are using polkit?

thank you all for your help :slight_smile: and happy holiday season.

@guinux
i believe i found the issue, since as far as i can see it’s your code, i would like to get your opinion on it.

on
https://gitlab.manjaro.org/applications/pamac/-/blame/master/src/cli.vala#L36
it checks for need_pktty based on if the env var DESKTOP_SESSION is set and skips the pkttyagent on line
https://gitlab.manjaro.org/applications/pamac/-/blame/master/src/cli.vala#L903
based on it.

however since i’m working from a terminal shouldn’t it look rather for env var TERM ? or at least in addition to it?

PS: sorry for the misformed links, seems i can’t add links to posts.

Maintainers build packages using a clean chrooted environment - to ensure that all dependencies resolve and the package builds.

I don’t know how @guinux has coded Pamac but it could be a similar approach.

The reason building as root on a live system is blocked is the potential damage root do to the system.

With v10, even when run as root, pamac is able to build as a standard user thanks to system dynamic user.

Yes for now pamac check if it’s run from a desktop session and don’t start pkttyagent in this case assuming another authentication agent is running.
With this thread, I see it’snot the always the case. I already found a way to fix this. Will be available soon.

1 Like

No by default pamac doesn’t build in a chroot environment. Even if it’s possible, the main usage is to build a package for the local system.