Re: [Dorset] Updating Applications Installed by Snap

2020-04-27 Thread Ralph Corderoy
Hi Terry,

> My wife switched the laptop on at around 0850 this morning

‘who -b’ will show boot time.

> used it for about five or ten minutes and then left it.  When I picked
> it up just now it had shut the screen down, but was till running.  I
> logged in and got:
>
> terry@XPS-13:~$ snap refresh --time
> timer: 00:00~24:00/4
> last: today at 08:54 BST
> next: today at 12:51 BST
>
> I then did a manual refresh:
>
> terry@XPS-13:~$ snap refresh
> 2020-04-27T10:33:06+01:00 INFO Waiting for restart...
> core18 20200311 from Canonical✓ refreshed
> gtk-common-themes 0.1-36-gc75f853 from Canonical✓ refreshed
> snapd 2.44.3 from Canonical✓ refreshed
>
> So in theory, had those updated Apps been available at 0854 she would
> have got them.  I'm assuming that they weren't then and they've only
> been applied now  because I did a manual refresh.

A reasonable assumption, though it seems quite a few updates became
available in that ninety minutes.

> The chances of the machine being alive at 1251 are low, so at the next
> scheduled refresh time the machine would have been asleep or shut down
> completely.

Yes, but the previous one happened within ten minutes of booting after
it had been off for longer than six hours and missed a scheduled update.
When it's turned on having missed 12:51, the same will presumably occur.

> Even so, the chances are that those Apps would have been caught the
> next time the machine was used, so this begs the question; why were
> able to use the machine for nearly five months without snap refreshing
> Chromium?

I don't know.  I'd suggest learning a bit more about snap to see what it
can tell you.  (I haven't used it.)

There's ‘snap changes --abs-time’ and for a listed change ID, e.g. 42,
one can do ‘snap change 42’ for more detail.  And then I'd expect ‘snap
info --verbose core18’ might give some detail, hopefully including what
versions became available when.

Finally, a log file or journal entry might show when snap checked for
updates and what decisions it made, and they might mention Chromium.

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-27 Thread Terry Coles
On Sunday, 26 April 2020 14:21:49 BST Terry Coles wrote:
> I'll check first thing tomorrow.  The laptop is off now.

This is interesting.  My wife switched the laptop on at around 0850 this 
morning, used it for about five or ten minutes and then left it.  When I picked 
it up just now it had shut the screen down, but was till running.  I logged in 
and got:

terry@XPS-13:~$ snap refresh --time
timer: 00:00~24:00/4
last: today at 08:54 BST
next: today at 12:51 BST

I then did a manual refresh:

terry@XPS-13:~$ snap refresh
2020-04-27T10:33:06+01:00 INFO Waiting for restart...
core18 20200311 from Canonical✓ refreshed
gtk-common-themes 0.1-36-gc75f853 from Canonical✓ refreshed
snapd 2.44.3 from Canonical✓ refreshed

So in theory, had those updated Apps been available at 0854 she would have got 
them.  I'm assuming that they weren't then and they've only been applied now  
because I did a manual refresh.  The chances of the machine being alive at 
1251 are low, so at the next scheduled refresh time the machine would have 
been asleep or shut down completely.

Even so, the chances are that those Apps would have been caught the next time 
the machine was used, so this begs the question; why were able to use the 
machine for nearly five months without snap refreshing Chromium?

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 15:38:54 BST aidangcole--- via dorset wrote:
> With all due respect, I think that it is possible that we might be
> talking at cross-purposes

Yes.  And we still are.

You can administer for you wife and I can administer for mine.  However, there 
are presumably thousands of non-technical users (and not just wives, I hasten 
to add), who don't have a technical spouse or significant other who can 'fix' 
this for them and wouldn't know they need to.

I started out simply 'tipping off' readers of this List about the potential for 
this problem, because many of them may well be in the same boat.  The bigger 
picture however is the rest of the world, which is why I think a bug report is 
in order here.

Maybe the Launchpad developers will point out the error of my ways, but if 
they do, it still begs the question of why this happened in the first place.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread aidangcole--- via dorset


With all due respect, I think that it is possible that we might be 
talking at cross-purposes


OK, I get that some users are non-technical.
My wife sounds much like yours in that regard, and looks to either 
myself or my son when it comes to this sort of thing, and fair enough.
It is therefore down to the likes of you and me to take on the task of 
administrator and to make the life of the everyday users easier, and 
easier for those who are not technical and probably don't wish to get 
involved in technical aspects of things.


I therefore offered you a possible action to consider - ie _you_ set the 
thing to run automatically on startup for her, and hand the machine back 
to her.


Meanwhile, it does sound as if something has indeed got lost in the 
telling somewhere as far as the updating of that particular snap is 
concerned, and that hopefully raising the issue on launchpad will bring 
things to the fore for yourself, your wife and everyone.  I suspect that 
the likely problem will be actually less to do with snapcraft and more 
to do with the developer and the channel used, but that of course 
remains to be seen.




On 26/04/2020 15:13, Terry Coles wrote:

On Sunday, 26 April 2020 15:01:39 BST aidangcole--- via dorset wrote:

If that were me, and I was that troubled by it, then I'd set a snap
refresh to run on startup or delayed startup, and then hand the machine
back to the user and forget about it

Sorry to keep harping on about this, but the average non-technical user
wouldn't have a clue how to do that.

This isn't about me, it's about people like my wife, who prefer to run Linux
because it is more secure than Windows, but don't know one end of a bash shell
from the other, let alone a cron job.

Anyway.  Since I last posted, I've established that the version of Chromium
that was on the laptop was released in early December, so even though (until
recently) I was often using it for several hours at a time (such as at a LUG
Meeting (when we still had them) it never caught a refresh.

I really think that the snap developers haven't thought of this so unless
someone can come up with a logical explanation why *my* particular laptop
isn't updating, other than what I've suggested, I'll probably raise a bug
report on Launchpad.

(I did do a search but couldn't find a bug that resembled this.)



--
 Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 15:01:39 BST aidangcole--- via dorset wrote:
> If that were me, and I was that troubled by it, then I'd set a snap
> refresh to run on startup or delayed startup, and then hand the machine
> back to the user and forget about it

Sorry to keep harping on about this, but the average non-technical user 
wouldn't have a clue how to do that.

This isn't about me, it's about people like my wife, who prefer to run Linux 
because it is more secure than Windows, but don't know one end of a bash shell 
from the other, let alone a cron job.

Anyway.  Since I last posted, I've established that the version of Chromium 
that was on the laptop was released in early December, so even though (until 
recently) I was often using it for several hours at a time (such as at a LUG 
Meeting (when we still had them) it never caught a refresh.

I really think that the snap developers haven't thought of this so unless 
someone can come up with a logical explanation why *my* particular laptop 
isn't updating, other than what I've suggested, I'll probably raise a bug 
report on Launchpad.

(I did do a search but couldn't find a bug that resembled this.)

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread aidangcole--- via dorset

Fair point

If that were me, and I was that troubled by it, then I'd set a snap 
refresh to run on startup or delayed startup, and then hand the machine 
back to the user and forget about it




On 26/04/2020 14:29, Terry Coles wrote:

On Sunday, 26 April 2020 14:19:48 BST aidangcole--- via dorset wrote:

Don't know if I am missing the point, but why not at your convenience
just do a:

sudo snap refresh to update any installed snap packages

or

sudo snap refresh /package-name/ to update a specific snap package
//

Mainly because it isn't that convenient to run that all the time.  You are
absolutely right, I could do sudo snap refresh each time I booted up, but my
wife would feel somewhat less comfortable with doing that instead of simply
clicking on the alert when Discover Update prompts her.

Also, I do think you *are* missing the point a bit.  Many users aren't
developers or system administrators, so how do they know they have to do this?

I only found out by accident.



--
 Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 14:19:48 BST aidangcole--- via dorset wrote:
> Don't know if I am missing the point, but why not at your convenience
> just do a:
> 
> sudo snap refresh to update any installed snap packages
> 
> or
> 
> sudo snap refresh /package-name/ to update a specific snap package
> //

Mainly because it isn't that convenient to run that all the time.  You are 
absolutely right, I could do sudo snap refresh each time I booted up, but my 
wife would feel somewhat less comfortable with doing that instead of simply 
clicking on the alert when Discover Update prompts her.

Also, I do think you *are* missing the point a bit.  Many users aren't 
developers or system administrators, so how do they know they have to do this?

I only found out by accident.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 14:07:40 BST Ralph Corderoy wrote:
> Which they know, as I've already said, so I'd be surprised if there's no
> mechanism to cope.  When the laptop gets turned on tomorrow, it will be
> interesting to see what ‘snap refresh --time’ then plans to do.

My earlier post was slightly misleading.  For convenience, I posted what I got 
from my Desktop, since I was posting from there.  The output of the command on 
the laptop just now was:

timer: 00:00~24:00/4
last: today at 12:27 BST
next: today at 19:31 BST

I think I did the manual refresh at 12:27.

I'll check first thing tomorrow.  The laptop is off now.

> If the laptop is only ever on for 30 minutes at a time then the attempt
> to avoid doing lots of timely things soon after power on might result in
> few of them running time after time?

Exactly and most people wouldn't realise that.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread aidangcole--- via dorset
Don't know if I am missing the point, but why not at your convenience 
just do a:


sudo snap refresh to update any installed snap packages

or

sudo snap refresh /package-name/ to update a specific snap package
//



Aidan


On 26/04/2020 14:07, Ralph Corderoy wrote:

Hi Terry,


terry@OptiPlex:~$ snap refresh --time
timer: 00:00~24:00/4
last: today at 13:22 BST
next: today at 22:08 BST

That says it all really.  We are likely to be eating lunch (or washing
up) at 13:22 and in bed / watching TV at 22:08.

Yes, I think it's a good idea to ensure the laptop is off and cannot
refresh tonight at 10 p.m.


The trouble is that since that is the default, most people would get
caught by this unless they run their machines all day.

Which they know, as I've already said, so I'd be surprised if there's no
mechanism to cope.  When the laptop gets turned on tomorrow, it will be
interesting to see what ‘snap refresh --time’ then plans to do.

I'm wondering if an element of randomisation of the next +6 hour time,
say by ±2 hours, is causing your symptoms.  The gap you show above is a
lot more than the ‘/4’ suggests.

 $ units '22hour+8min - 13hour-22min' time
 8 hr + 46 min

If the laptop is only ever on for 30 minutes at a time then the attempt
to avoid doing lots of timely things soon after power on might result in
few of them running time after time?



--
 Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
 Check to whom you are replying
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Ralph Corderoy
Hi Terry,

> terry@OptiPlex:~$ snap refresh --time
> timer: 00:00~24:00/4
> last: today at 13:22 BST
> next: today at 22:08 BST
>
> That says it all really.  We are likely to be eating lunch (or washing
> up) at 13:22 and in bed / watching TV at 22:08.

Yes, I think it's a good idea to ensure the laptop is off and cannot
refresh tonight at 10 p.m.

> The trouble is that since that is the default, most people would get
> caught by this unless they run their machines all day.

Which they know, as I've already said, so I'd be surprised if there's no
mechanism to cope.  When the laptop gets turned on tomorrow, it will be
interesting to see what ‘snap refresh --time’ then plans to do.

I'm wondering if an element of randomisation of the next +6 hour time,
say by ±2 hours, is causing your symptoms.  The gap you show above is a
lot more than the ‘/4’ suggests.

$ units '22hour+8min - 13hour-22min' time
8 hr + 46 min

If the laptop is only ever on for 30 minutes at a time then the attempt
to avoid doing lots of timely things soon after power on might result in
few of them running time after time?

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 13:36:49 BST Terry Coles wrote:
> That says it all really.  We are likely to be eating lunch (or washing up)
> at 13:22 and in bed / watching TV at 22:08.
> 
> The trouble is that since that is the default, most people would get caught
> by this unless they run their machines all day.

Reading further on the 'Manage updates page it says:

'refresh.timer
Use refresh.timer to modify when, and how frequently, your snaps are 
refreshed.

The following example asks the system to only refresh snaps between 4.00am and 
7.00am, and 7.00pm and 10:10pm:

$ sudo snap set system refresh.timer=4:00-7:00,19:00-22:10 
Other examples for the time and frequency option include:
etc'

For the life of me I can't see how to change the *frequency* of the refreshes, 
only how to set bounds on the when they occur.  If I could use the 
refresh.timer switch to stop refreshes occurring before 0700 or after 1800 
*and* (say) 10 time a day, then it might be possible to catch the a refresh 
since they would be occurring every 54 minutes.

Having said that, this wouldn't help the ordinary user who doesn't even 
realise what's happening.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
On Sunday, 26 April 2020 13:17:14 BST Ralph Corderoy wrote:
> What's the output of ‘snap refresh --time’?

terry@OptiPlex:~$ snap refresh --time
timer: 00:00~24:00/4
last: today at 13:22 BST
next: today at 22:08 BST

That says it all really.  We are likely to be eating lunch (or washing up) at 
13:22 and in bed / watching TV at 22:08.

The trouble is that since that is the default, most people would get caught by 
this unless they run their machines all day.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Ralph Corderoy
Hi Terry,

> 'Managing updates
> Snaps update automatically, and by default, the snapd daemon checks for 
> updates 4 times a day. Each update check is called a refresh.'
>
> Our laptop tends to get used intermittently, so if it is only switched
> on for an hour or two then it is likely that a routine refresh will be
> missed.

Which is a common situation now and I'd expect it to be handled.  Cron
jobs run at fixed times, but there are other timer mechanisms which
compare the current time to when they were last run precisely to cope
with this.

> It would be nice if the snapd daemon checked for updates on boot-up
> (or more frequently than four times a day), as the Discover Updater
> does.

What's the output of ‘snap refresh --time’?

-- 
Cheers, Ralph.

-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


[Dorset] Updating Applications Installed by Snap

2020-04-26 Thread Terry Coles
Hi,

My wife recently read an online article regarding a vulnerablity in Chromium 
which was pretty nasty.  I also read the article a few days ago and having 
checked the version of Chromium on this desktop PC, found that it was up to 
date.

However, my wife uses our laptop and when we checked the version number of the 
Chromium installation on the laptop I found that the version number was quite 
old.  How could this be I thought when both machines are running Kubuntu 
19.10?

I have now found the cause of the problem, I think, and it's to do with how 
snap updates are applied.  This website:

https://snapcraft.io/blog/chromium-in-ubuntu-deb-to-snap-transition

explains how Ubuntu (and therefore Kubuntu) is transitioning to snaps for 
Chromium.  This website:

https://snapcraft.io/docs/getting-started

tells us all about snaps and this website:

https://snapcraft.io/docs/keeping-snaps-up-to-date

tells us how apps that were installed using snap are updated:

From this page the following words are important:

'Managing updates
Snaps update automatically, and by default, the snapd daemon checks for 
updates 4 times a day. Each update check is called a refresh.'

Our laptop tends to get used intermittently, so if it is only switched on for 
an hour or two then it is likely that a routine refresh will be missed.  I 
suspect that is what happened with us because when I did a manual refresh, the 
Chromium App on the laptop was updated to be the same as the one on the 
Desktop.

It would be nice if the snapd daemon checked for updates on boot-up (or more 
frequently than four times a day), as the Discover Updater does.

-- 



Terry Coles



-- 
  Next meeting: Online, Jitsi, Tuesday, 2020-05-05 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk