[SOLVED] can't launch nemo with pkexec, polkit files issue maybe

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dkebler
Level 1
Level 1
Posts: 26
Joined: Thu Aug 07, 2014 2:48 pm

[SOLVED] can't launch nemo with pkexec, polkit files issue maybe

Post by dkebler »

I have a newish install of mint 21 cinnamon

Seems there is some issue with polkit/pkexec

If I try to launch nemo with the context menu "open as root" nothing opens

if I drop to terminal and try

Code: Select all

pkexec nemo
Could not parse arguments: Cannot open display: 
if I try

Code: Select all

 sudo nemo .
then it works

According to my searches it may mean that that there is no polkit file nemo. It seems I might have issues with missing pollkit files for other apps too.
Why did this install fail to get the polkit files set up correctly? How to I fix this short of a fresh install because at this point as I've set up too many other things to start over.

Also having similar problem launching mintsources

Code: Select all

pkexec mintsources

(mintSources.py:164192): Gtk-CRITICAL **: 09:20:50.182: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(mintSources.py:164192): Gtk-CRITICAL **: 09:20:50.182: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(mintSources.py:164192): Gtk-CRITICAL **: 09:20:50.182: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
if I run just `mintsources` then I still get the elevation prompt but then it opens. Again an issue with pkexec and polkit
Last edited by LockBot on Wed May 24, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
t42
Level 11
Level 11
Posts: 3743
Joined: Mon Jan 20, 2014 6:48 pm

Re: can't launch nemo with pkexec, polkit files issue maybe

Post by t42 »

what happens if you run

Code: Select all

DISPLAY=:0 pkexec nemo
-=t42=-
dkebler
Level 1
Level 1
Posts: 26
Joined: Thu Aug 07, 2014 2:48 pm

Re: can't launch nemo with pkexec, polkit files issue maybe

Post by dkebler »

no that doesn't work

But

Code: Select all

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY nemo
works.

see this good explanation
https://askubuntu.com/a/332847

So the question is WHY is this so in mint21/jammy? in mint20/focal it just worked out of the box.

Something didn't get set up the same as regards polkit and root at least in my install. Or maybe this is just the way it is now? That doesn't make sense why would mint distribute all these desktop files that need elevated privileges that don't work.
Last edited by dkebler on Sun Nov 27, 2022 12:58 pm, edited 1 time in total.
dkebler
Level 1
Level 1
Posts: 26
Joined: Thu Aug 07, 2014 2:48 pm

Re: can't launch nemo with pkexec, polkit files issue maybe

Post by dkebler »

and per that post the polkit doesn have allow_gui set to I don't understand why the display and Xauth are not passed.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">

<policyconfig>

 <vendor>Nemo Project</vendor>
 <vendor_url>https://github.com/linuxmint/nemo</vendor_url>

 <action id="org.nemo.root">
   <description>Run Nemo with elevated privileges</description>
   <message gettext-domain="nemo">Files</message>
   <icon_name>gksu-root-terminal</icon_name>
   <defaults>
     <allow_any>no</allow_any>
     <allow_inactive>no</allow_inactive>
     <allow_active>auth_admin_keep</allow_active>
   </defaults>
   <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/nemo</annotate>
   <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
 </action>

</policyconfig>
dkebler
Level 1
Level 1
Posts: 26
Joined: Thu Aug 07, 2014 2:48 pm

Re: can't launch nemo with pkexec, polkit files issue maybe

Post by dkebler »

Well as it turns out for whatever reasons there are missing pkexec policy files....but why really, mintsources and nemo are integral and should ship with these.

So I had to make them

1. go to /mnt/645/nadal/root/usr/share/polkit-1/actions
2. copy com.ubuntu.pkexec.synaptic.policy to nemo.policy and mintsources.policy
3. edit those and copy and replace synaptic and also make sure the bin path is correct (try which nemo)

At this point if these is going to be an issue on ALL future release might as well keep these file around to just copy in a new install.

IMHO this is a issue with the disto packaging. (as of LMDE5 and LM22)
t42
Level 11
Level 11
Posts: 3743
Joined: Mon Jan 20, 2014 6:48 pm

Re: can't launch nemo with pkexec, polkit files issue maybe

Post by t42 »

dkebler wrote: Wed Feb 01, 2023 9:16 pm IMHO this is a issue with the disto packaging. (as of LMDE5 and LM22)
There is no issue on LM21. After installation no problem with running pkexec nemo , pkexec mintsources , DISPLAY=:0 pkexec nemo. Consider changes you did to the system after the installation.
-=t42=-
Locked

Return to “Software & Applications”