You are not logged in.

#1 2016-02-02 23:51:51

searchone
Member
From: Walhalla
Registered: 2016-01-31
Posts: 107

automatic notification of updates?

Hi, I have again a question: is there at our beautiful Distri the possibility (or function) an automatic notification of updates? Is indeed in many other distros yes available too. Could well imagine a shell script, or something of that nature.


------------
MOD EDIT: Topic moved from System Administartion

Last edited by damo (2016-02-04 00:11:36)


English by Google - blame them, Ich bin Deutscher.

Offline

#2 2016-02-03 00:15:48

spacex
Member
From: Norway
Registered: 2015-12-15
Posts: 66
Website

Re: automatic notification of updates?

searchone wrote:

Hi, I have again a question: is there at our beautiful Distri the possibility (or function) an automatic notification of updates? Is indeed in many other distros yes available too. Could well imagine a shell script, or something of that nature.

Update-Notifier? Link here:
https://packages.debian.org/jessie/update-notifier

Don't know if it's good or not. I don't use it.


Regards Spacex(EW)

"If you have any trouble sounding condescending, find a UNIX user to show you how it's done." — Scott Adams, Dilbert Cartoonist

Offline

#3 2016-02-03 00:16:37

damo
....moderator....
Registered: 2015-08-20
Posts: 5,835

Re: automatic notification of updates?

https://wiki.debian.org/UnattendedUpgrades

PS In the main menu there is Menu -> Help -> Debian, with links which could answer many of your questions wink

EDIT: update-notifier has been replaced by GNOME-packagekit

EDIT 2: What is wrong with running `sudo apt-get update && sudo apt-get upgrade -s` regularly? Either there is nothing to update or it will let you know.

Last edited by damo (2016-02-03 00:22:34)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#4 2016-02-03 00:52:50

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,180

Re: automatic notification of updates?

You can actually do this through conky. There is a format for the apt command that will generate the number of available updates - I can't find a conkyrc where I am using at the moment, but if you ask in the conky thread, I am sure S11 or someone else will have it.

Edit - now that I have thought about it some more, I think it is aptitude, not apt that is the application to use.

Last edited by PackRat (2016-02-03 13:30:02)


You must unlearn what you have learned.
    -- yoda

Online

#5 2016-02-03 00:59:22

damo
....moderator....
Registered: 2015-08-20
Posts: 5,835

Re: automatic notification of updates?

^ Never knew that! Investigating......


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#6 2016-02-03 01:31:59

ututo
Member
Registered: 2015-09-29
Posts: 279

Re: automatic notification of updates?

PackRat wrote:

You can actually do this through conky. There is a format for the apt command that will generate the number of available updates - I can't find a conkyrc where I am using at the moment, but if you ask in the conky thread, I am sure S11 or someone else will have it.

yeap... I can confirm that. A while ago I used such a config in my conkyrc. I'll try to find that conky config

CB_2013_06_a.jpg

Found it! To see available updates you can add this line to your conky:

${execi 3600 aptitude search "~U" | wc -l}

Last edited by ututo (2016-02-03 01:55:48)


BunsenLabs on deviantArt
Don't touch my git!

Offline

#7 2016-02-03 02:23:46

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: automatic notification of updates?

^ Thanks for that utoto..

Offline

#8 2016-02-03 02:27:28

damo
....moderator....
Registered: 2015-08-20
Posts: 5,835

Re: automatic notification of updates?

I just found it as well!  The problem is that it only displays what was available for upgrade at the time of the last package update; and sudo is needed to do an update. So you may as well do it manually anyway! Unless....

A workaround is to add your $USER to `/etc/sudoers` to run aptitude without needing a password. Then the following commands work in a terminal:

sudo aptitude update &>/dev/null && aptitude search "~U" | wc -l

This could be put in a script, which is called by execi

${execi 3600 $HOME/.config/conky/scripts/updates.sh}

Last edited by damo (2016-02-03 02:42:19)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#9 2016-02-03 04:25:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,561
Website

Re: automatic notification of updates?

I haven't tried it, but could regular 'apt-get update' be made a root cron job?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#10 2016-02-03 04:29:04

damo
....moderator....
Registered: 2015-08-20
Posts: 5,835

Re: automatic notification of updates?

johnraff wrote:

I haven't tried it, but could regular 'apt-get update' be made a root cron job?

That would speed up the start of the conky, if only the `aptitude search` had to be done.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#11 2016-02-03 04:47:43

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: automatic notification of updates?

I was thinking along the same lines. Here's a link from the #! forums explaining it http://crunchbang.org/forums/viewtopic.php?id=10602

Offline

#12 2016-02-03 05:57:40

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: automatic notification of updates?

I was able to get this working via the following code:
First, the shell script:

#!/bin/bash
sudo apt update > /dev/null 2>&1
NUMOFUPDATES=$(aptitude search "~U" | wc -l)
echo $NUMOFUPDATES

I saved the file as ~/bin/debupdates.sh
Next, edit crontab -e as follows:

 1 *   *   *   *    cd $HOME/bin && ./debupdates.sh

and save it. This should run the script hourly at one minute past the hour. I have an rsync backup script running at the top of the hour, so I chose to delay the update script by a bit.
Finally, the relevant conky code:

${font Exo-Bold:size=11}${color 0047ab}Updates: ${font Open-Sans:size=9}${color FF4500}${execi 3600 aptitude search "~U" | wc -l}

I fiddled around a bit with notifcations as well. I could get notify-send to sort of work but it was not using the theming set in xfce4-notifyd. dbus-send was not working at all. Upon reading that sending notifications from crontab is problematic, given that crontab runs as root, I decided to abandon that approach. I may poke around a bit more and see if I can get the update script to run as a systemd unit file running as --user instead of --session and see if I can get desktop notifications working that way.

Offline

#13 2016-02-03 08:31:32

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: automatic notification of updates?

spacex wrote:
Your link wrote:

Transitional dummy package replacing update-notifier with GNOME-PackageKit.

wink

The old update-notifier was dropped for jessie and GNOME-packagekit is the replacement.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#14 2016-02-03 13:13:04

spacex
Member
From: Norway
Registered: 2015-12-15
Posts: 66
Website

Re: automatic notification of updates?

Head_on_a_Stick wrote:
spacex wrote:
Your link wrote:

Transitional dummy package replacing update-notifier with GNOME-PackageKit.

wink

The old update-notifier was dropped for jessie and GNOME-packagekit is the replacement.

Ok.It's not for me anyways. In unstable "distup" is the first thing I do after each boot, and with fast SSD's I've actually changed my habits, and do power off every time I'm not using the laptop. Don't use any kind of hibernation any more. So I upgrade Unstable at least once a day. With Stable it's enough to check once a month. I don't need a notifier. It would only distract me, as I would feel compelled to always upgrade there and then, with each notification. My OCD wouldn't allow me to see that there is updates available, without actually upgrading them. cool


Regards Spacex(EW)

"If you have any trouble sounding condescending, find a UNIX user to show you how it's done." — Scott Adams, Dilbert Cartoonist

Offline

#15 2016-02-03 23:41:45

dolly
Miss Mixunderstand
From: /lab1
Registered: 2015-10-03
Posts: 398

Re: automatic notification of updates?

No thank you, it is very irritating with "update available popups". Anyway, doesn`t this thread really belong in the development & suggestion forum?

Last edited by dolly (2016-02-03 23:46:21)


Keep BunsenLabs #!yish please.

Offline

#16 2016-02-04 00:09:12

damo
....moderator....
Registered: 2015-08-20
Posts: 5,835

Re: automatic notification of updates?

dolly wrote:

....Anyway, doesn`t this thread really belong in the development & suggestion forum?

You are probably right about that.

...and just to reassure everyone, I think it is highly improbable that any kind of auto-notification would ever be included in a BL release. I think most would loathe it, but the info being developed in this thread might be useful for someone wanting the "feature" wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#17 2016-02-04 02:28:28

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: automatic notification of updates?

Actually, it would probably be better off in Tips, Tutorials, and Scripts if it is not intended to be mainstream BL. However, given that I frequently forget to update my sid box and end up with 140 packages to update, I see some value in it. I am currently playing around with a different idea involving a systemd service and timer and possibly a tint2 button that will show the number of updates and launch a terminal to perform the update. I intend to go about this by copying tint2rc into /dev/shm and modifying it there, then relaunching tint2. My main concern is that openbox likes to reorganize all the open windows when tint2 is restarted so I am not 100% sure I can make it work without it being majorly annoying.

As I expected, I did notice some syncing issues between cron and conky today.

Offline

#18 2016-02-04 07:18:25

hhh
Meep!
Registered: 2015-09-17
Posts: 9,309
Website

Re: automatic notification of updates?

My 2 cents.

gnome-packagekit is broken in BunsenLabs and maybe even in GNOME, I don't know. When it worked, it was very cool to see the systray icon appear, but then it wouldn't work. And then you're running apt anyway to find out what's up, so just

sudo apt update && sudo apt upgrade

and be done with it. #firstworldproblems my auto-notification is busted

Offline

#19 2016-02-04 08:14:49

ohnonot
...again
Registered: 2015-09-29
Posts: 4,418
Website

Re: automatic notification of updates?

just my 2ct: i agree with replies #3 and #18.
i prefer manual updates & upgrades.

if you really want it on your conky, you can tell sudo to grant the user su privileges only for certain commands.
i think it's a safer solution.
example:

username ALL=NOPASSWD: /usr/bin/geany,/usr/bin/gparted,/usr/bin/apt-get

and just execute the required commands in a row, with "${execi...". in my experience recent conky versions are well able to understand that the script will take a while to execute, and they don't get hung up on it.

Offline

#20 2016-02-04 08:34:37

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,561
Website

Re: automatic notification of updates?

As long as you update apt-get regularly with a root-level process, just checking for new packages (with ' apt list --upgradable' as PackRat pointed out) and conkying the result can all be done at user level.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#21 2016-02-04 17:20:44

lamarca
Member
From: rio de janeiro
Registered: 2015-11-27
Posts: 448
Website

Re: automatic notification of updates?

got it from all commands:

sudo apt-get -s upgrade | awk '/Inst.+/ { print \$2}'

Offline

#22 2016-02-05 03:42:55

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,561
Website

Re: automatic notification of updates?

^that one will still need 'sudo apt-get update' to be run first.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#23 2016-02-05 07:45:02

ohnonot
...again
Registered: 2015-09-29
Posts: 4,418
Website

Re: automatic notification of updates?

sudo apt-get update >/dev/null 2>&1 && sudo apt-get -s upgrade | awk '/Inst.+/ { print \$2}'

that should do it.
i wouldn't execute this more often than once a day.

Offline

#24 2016-02-05 15:13:04

lamarca
Member
From: rio de janeiro
Registered: 2015-11-27
Posts: 448
Website

Re: automatic notification of updates?

johnraff wrote:

^that one will still need 'sudo apt-get update' to be run first.

indeed.

Offline

#25 2016-02-05 22:46:30

pvsage
Internal Affairs
Registered: 2015-09-29
Posts: 1,433

Re: automatic notification of updates?

Regarding the need to run apt-get update as root/su, how do utilities like unattended-upgrades get around this?  I'm looking at that package's wiki page and I don't see...


Be excellent to each other, and...party on, dudes!
BunsenLabs Forum Rules
Tending and defending the Flame since 2009

Offline

Board footer

Powered by FluxBB