synaptic-pkexec fails: cannot open display 0

Bug #829099 reported by Jonathan Thomas on 2011-08-18
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
synaptic (Ubuntu)
Undecided
Unassigned

Bug Description

jonathan@jonathan-laptop:~/$ synaptic-pkexec
No protocol specified

(synaptic:10136): Gtk-WARNING **: cannot open display: :0

Using synaptic 0.75.2ubuntu6.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: synaptic 0.75.2ubuntu6 [modified: usr/share/applications/synaptic-kde.desktop]
ProcVersionSignature: Ubuntu 3.0.0-8.10-generic-pae 3.0.1
Uname: Linux 3.0.0-8-generic-pae i686
Architecture: i386
Date: Thu Aug 18 19:40:28 2011
InstallationMedia: Kubuntu 10.10 "Maverick Meerkat" - Release Candidate i386 (20100928.3)
ProcEnviron:
 LANGUAGE=en
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 LC_MESSAGES=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: synaptic
UpgradeStatus: No upgrade log present (probably fresh install)

Jonathan Thomas (echidnaman) wrote :
Changed in synaptic (Ubuntu):
status: New → Confirmed

when using kdm on a freshly updated oneiric amd64 box,

pkexec synaptic fails in a unity session (cannot open display: :0). That means starting it from a launcher/dash icon fails.

Under a kde session synaptic is started with the kde sudo program, so synaptic can be started from the gui with kde destop, but not with unity desktop.

I am far away from the box with both desktops installed now, so i cannot check the contents/existence of the suspected file

/usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy

hi!
running 11.10, KDE-SC 4.8 from backports. Synaptic does not start from menu. But with Krunnner (Alt+F2) and prefix "kdesudo"

usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy (content):

<?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>

  <action id="com.ubuntu.pkexec.synaptic">
    <message>Authentication is required to run the Synaptic Package Manager</message>
    <icon_name>synaptic</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/synaptic</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>

</policyconfig>

Jonathan Thomas (echidnaman) wrote :

Works now in 12.04.

Changed in synaptic (Ubuntu):
status: Confirmed → Fix Released
abbot (shamardin) wrote :

I still have this problem on 12.04:

lev@darwin:~$ lsb_release -d
Description: Ubuntu 12.04 LTS
lev@darwin:~$ synaptic-pkexec
No protocol specified
No protocol specified

(synaptic:12421): Gtk-WARNING **: cannot open display: :0

rickyrockrat (rickyrockrat) wrote :

I can confirm the problem. changing the display variable changes the message:
export DISPLAY=:0.0

On a fresh install, it worked, but then I changed from slim to wdm login manager and it stopped working. Using Xfce4 on 12.04.1

rickyrockrat (rickyrockrat) wrote :

So the plot sickens.. I can start Xfce4 with startxfce4 from a tty, and synaptic works. If I use wdm to start xfce4, it does not. The DISPLAY variable for both is :0.0

It turns out that WDM does not set XAUTHORITY. If you export it like so in the terminal window:
export XAUTHORITY=$HOME/.Xauthority

it runs. The bug is with WDM.

rickyrockrat (rickyrockrat) wrote :

I have a work around. It turns out, if .Xauthority is unwriteable, it will put the auth file somewhere else and set the XAUTHORITY variable. Heh.

So log out of your window manager, then stop WDM. Remove .Xauthority and make it a directory. This cause WDM to create a different location and set the variable.

What a PITA!

Nikolay Epifanov (nicktime) wrote :

The bug is still there, I have this problem as well. According to
https://bugs.freedesktop.org/show_bug.cgi?id=51623
pkexec has been fixed but it still has a problem in Ubuntu 12.04.

Nikolay Epifanov (nicktime) wrote :

As a workaround putting into $HOME/.profile a line
if [[ -z "$XAUTHORITY" ]]; then export XAUTHORITY=~/.Xauthority; fi
did the trick for me.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.