Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

I've done something to stop apt-notifier from working properly with root permissions

Post Reply
Message
Author
nathan2423
Forum Regular
Forum Regular
Posts: 290
Joined: Tue Dec 22, 2015 8:33 am

I've done something to stop apt-notifier from working properly with root permissions

#1 Post by nathan2423 » Wed Aug 08, 2018 8:04 am

I am sure this is a problem I created for myself, but if anyone knows a solution I would still appreciate help fixing it.

I recently installed LXDE as an experiment, and in switching back and forth between desktops, I now find that when I am back running XFCE as normal that my apt-notifier icon no longer seems to work properly. I can click on it, it pops up, and I see the upgrades, but when I click the button to upgrade it does not ask for root permissions and just seems to stop.

I started apt-notifier from terminal and get this output:

Code: Select all

$ apt-notifier
ddd@lenovosl410:~
$ qt5ct: using qt5ct plugin
qt5ct: D-Bus system tray: no
inotify_add_watch("/home/ddd/.config/qt5ct/") failed: "No such file or directory"
/tmp/tmppjx_sD: line 91: kde4-config: command not found
/tmp/tmppjx_sD: line 91: kdesu: command not found
$ 
Even if I start apt-notifier as root from terminal, I get pretty much the same result:

Code: Select all

$ sudo apt-notifier

$ /tmp/tmpnJWU1H: line 91: kde4-config: command not found
/tmp/tmpnJWU1H: line 91: kdesu: command not found
/tmp/tmpx_0QMZ: line 91: kde4-config: command not found
/tmp/tmpx_0QMZ: line 91: kdesu: command not found

I can tell it to upgrade using synaptic and upgrade that way, so this is not an urgent problem, but I am always trying to expand my understanding of linux so it appears to me that somehow apt-notifier does not know to ask for root permissions.

I'm not sure how to get this kdesu command working as it is not installable itself (apt get install kdesu doesn't work)

Can anyone suggest a remedy?

thanks very much.

User avatar
Jerry3904
Forum Veteran
Forum Veteran
Posts: 23014
Joined: Wed Jul 19, 2006 6:13 am

Re: I've done something to stop apt-notifier from working properly with root permissions

#2 Post by Jerry3904 » Wed Aug 08, 2018 8:09 am

Purge and reinstall would be my unsubtle approach.
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

nathan2423
Forum Regular
Forum Regular
Posts: 290
Joined: Tue Dec 22, 2015 8:33 am

Re: I've done something to stop apt-notifier from working properly with root permissions

#3 Post by nathan2423 » Wed Aug 08, 2018 2:33 pm

Wow what an obvious answer. Thank you Jerry!

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 9406
Joined: Wed Jul 12, 2006 2:26 pm

Re: I've done something to stop apt-notifier from working properly with root permissions

#4 Post by kmathern » Thu Aug 09, 2018 12:11 pm

Prior to requesting root privileges, the apt-notifier first uses the xprop command below to try to determine if the user is in a KDE session or something else (i.e. XFCE, etc.).

Code: Select all

xprop -root | grep -q -i kde
Unfortunately it looks like 'kde' also shows up in the output when running in a LXDE session and it is therefore trying to put up a kdesu dialog (which isn't installed), and fails.

There might be a better way to determine what type desktop is being used than the xprop command I'm currently using, but I'm not sure how much effort to put into it. For Debian Buster I'm going to have to change over to using pkexec when requesting root privileges instead of using gksu (or kdesu), and users of all desktops types will probably be presented with the same dialog. With that I probably won't need to determine what type desktop is being used.

Btw this all goes back to when the apt-notifer was being used by both MEPIS 12 and MX-14. If it found that the user was running KDE (MEPIS 12), it would present a kdesu dialog when requesting root privileges instead of the gksu dialog. The thought was that longtime KDE (MEPIS 8.5,11,12) users were used to seeing the kdesu dialog and might question things if it all of a sudden changed to using gksu.

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 9406
Joined: Wed Jul 12, 2006 2:26 pm

Re: I've done something to stop apt-notifier from working properly with root permissions

#5 Post by kmathern » Thu Aug 09, 2018 2:00 pm

kmathern wrote:
Thu Aug 09, 2018 12:11 pm
..., but I'm not sure how much effort to put into it. For Debian Buster I'm going to have to change over to using pkexec when requesting root privileges instead of using gksu (or kdesu) ...
It looks like it wouldn't take that much to disable the code that's checking the desktop type, and just force it to use gksu for all desktop/window_manager types, for the time being.

Also looking at the error messages nathan2423 posted earlier & the apt-notifier code, it looks like the kdesu dialog probably isn't working anyway for MX-17/Stretch KDE users because I haven't updated it to account for the changes from KDE4 -> KDE5 that came about with the upgrade from a Jessie base to Stretch.

edit: done (https://github.com/MX-Linux/apt-notifie ... bfacbcfd12)

nathan2423
Forum Regular
Forum Regular
Posts: 290
Joined: Tue Dec 22, 2015 8:33 am

Re: I've done something to stop apt-notifier from working properly with root permissions

#6 Post by nathan2423 » Fri Aug 10, 2018 3:44 pm

Kmathern:

Thanks for the additional commentary! As you surmised, purging and reinstalling did not fix the problem, and my terminal output today is:

sudo apt-notifier (and it is the same whether i run as root or user)


$grep: write error: Broken pipe
grep: write error: Broken pipe
grep: write error: Broken pipe
grep: write error: Broken pipe
grep: write error: Broken pipe


Thank you for looking into this! Have you posted an updated deb package anywhere that I can use to fix this?'

Again - thanks!!! I hope my fumbling around has in a small way proved useful!

User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 9406
Joined: Wed Jul 12, 2006 2:26 pm

Re: I've done something to stop apt-notifier from working properly with root permissions

#7 Post by kmathern » Fri Aug 10, 2018 4:12 pm

nathan2423 wrote:
Fri Aug 10, 2018 3:44 pm
Have you posted an updated deb package anywhere that I can use to fix this?
I updated the .deb package and had Tim add it to the repos, so it should be showing up soon as an update. You can also grab it here: http://mxrepo.com/mx/repo/pool/main/a/a ... +1_all.deb and install with dpkg or gdebi.


Regarding the sudo errors, the apt-notifier is intended to be run as a regular user, not root. It will present a gksu dialog when it requires root privileges.

Post Reply

Return to “Software / Configuration”