Quantcast
Channel: Tux + Me » bug
Viewing all articles
Browse latest Browse all 9

Is GNOME Do launching Synaptic without admin rights?

$
0
0

Last week I took some updates that left me unable to use GNOME Do to launch Synaptic. After a bit of hunting I eventually posted a question on the GNOME Do Google Group asking about it.

Igor asked me if I run KDE, but before I could see the query I saw a post from Alex Launi that included a link to Bug #242992 – Do 0.5 open synaptic in non root mode. It turns out I’m definitely not the only one experiencing the issue. A Launchpad member with the amusing nick of Darwin Award Winner identified the cause of the problem and posted a workaround until the bug can be resolved properly.

I think I found the problem:

$ locate synaptic | grep desk

/usr/share/applications/synaptic-kde.desktop
/usr/share/applications/synaptic.desktop

$ cat /usr/share/applications/synaptic-kde.desktop
Name=Synaptic Package Manager

Exec=synaptic

X-KDE-SubstituteUID=true

synaptic-kde.desktop has the same “Name” field as the regular synaptic.desktop, so I guess it clobbers it in the serach results. KDE has a different “su” mechanism that doesn’t involve the Exec field, so any non-KDE-aware application that simply reads the “Exec” line will not know to run the program as root.

Here’s the basis for a cheap workaround: whichever of the two desktop entries sorts lexicographically higher takes precedence. As it is, a dash sorts higher than a period, so synaptic-kde.desktop beats synaptic.desktop. Simply change the dash to an underscore, and synaptic.desktop beats synaptic_kde.desktop, and balance and order will be restored to the universe (at least until the next update of the synaptic package clobbers the change).

$ mv /usr/share/applications/synaptic-kde.desktop /usr/share/applications/synaptic_kde.desktop

I suppose the real fix would be to support the “X-KDE-SubstituteUID” field, though I’m not sure how to do that.

I tried looking for the appropriate file in Nautilus, but I wasn’t sure I could handle the renaming with 100% certainty in Nautilus (I’m still working on my first cup of coffee) so I definitely recommend doing it from the command line.

There’s a question as to why we’d even have a /usr/share/applications/synaptic-kde.desktop in the first place if we’re running a primarily GNOME box, but I don’t have an answer for that. The good news is that you can simply delete /usr/share/applications/synaptic-kde.desktop if you’re running a primarily GNOME system. Darwin Award Winner also suggests a way to make it permanent on Debian-based systems.

I should note, if you want to make my workaround permanent (i.e. survive package updates) on a Debian-based system (e.g. Ubuntu), try this command, which should tell the package manager to divert the file to its new location:

sudo dpkg-divert –divert /usr/share/applications/synaptic_kde.desktop –local /usr/share/applications/synaptic-kde.desktop

I haven’t tried that yet but if you were to run it you wouldn’t have to worry about an update overriding your using the first workaround. Kudos to Alex Launi and Darwin Award Winner for helping me resolve the issue. I owe both of them a beer.



Viewing all articles
Browse latest Browse all 9

Trending Articles