Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Fixed] Hold Snap Application Update?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

[Fixed] Hold Snap Application Update?

#1 Post by bester69 »

Hi,

How can I hold any snap applicattion of updating?

I'd like to apply the equivalen for snaps of:
sudo apt-mark hold <<application>>



Thanks.
Last edited by bester69 on 2020-03-09 16:18, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#2 Post by bester69 »

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

We can use:
sudo snap set system refresh.hold="$(date --date=tomorrow +%Y-%m-%dT%H:%M:%S%:z)"

and query:
snap refresh --time
timer: 00:00~24:00/4
last: yesterday at 19:30 CET
hold: in 59 days, at 20:30 CEST
next: today at 05:41 CET (but held)
but it retains whole snap system.. I guess I will have to use chattr in folder application, something like.:
sudo chattr +i /snap/opera/
/snap/opera$ ls
66 67 current
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Hold Snap Application Update?

#3 Post by Head_on_a_Stick »

How about

Code: Select all

snap refresh --revision=$version $package
But you would have to repeat that every time the snaps are updated.
deadbang

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#4 Post by bester69 »

Head_on_a_Stick wrote:How about

Code: Select all

snap refresh --revision=$version $package
But you would have to repeat that every time the snaps are updated.
what does it do, put current version to $revision?..,

by default it keeps/retain two versions..everytime it updates, I guess its a FIFO method for updating, wont it delete oldest version first?

That would make it if its not using lowerest version number as the ID for a FIFO update
Last edited by bester69 on 2020-03-07 11:50, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Hold Snap Application Update?

#5 Post by Head_on_a_Stick »

bester69 wrote:what does it do, put current version to $revision?
I think so, yes. I'm just going from the man page. I don't use snap packages.
deadbang

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#6 Post by bester69 »

Head_on_a_Stick wrote:
bester69 wrote:what does it do, put current version to $revision?
I think so, yes. I'm just going from the man page. I don't use snap packages.
Thanks for help mate,

Im gonna use chattr to not take mayor risks and prevent an unwished update.

I will manually process snap updates by setting everytime "refresh.hold" to the maximum allowed of 60 days and apply script, so this way snapd daemon doesnt bother with chattr +i in snap folder. I will also exlude holded application (opera browser) from purge remove snap, so that snapd doesnt freeze when trying the purge in that protetected snap folder.

updates-snap.sh

Code: Select all

#!/bin/bash
clear

#Hold 60 días
sudo snap set system refresh.hold="2029-04-23T17:22:54+01:00"
snap refresh --time
sudo chattr +i /snap/opera/

sleep 3
 
snap list | awk -F" " '{if ($1 && NR>1) { system("sudo snap refresh " $1 "") }}'
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu

snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do   
    if [ "$snapname" == "opera" ]
    then
        :
    else
       sudo snap remove "$snapname" --revision="$revision"
    fi
     
    done
Last edited by bester69 on 2020-03-07 11:49, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#7 Post by bester69 »

I would like very much to know,

I wonder how can I go back to a specific older versions, that itsnt available in the branch anymore.
For example, I would like to know how can I install back Opera 65 in snap.. is there any way to point to that repository back manually. :?: :shock:


Thanks,
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: Hold Snap Application Update?

#8 Post by sunrat »

Head_on_a_Stick wrote: I think so, yes. I'm just going from the man page. I don't use snap packages.
Snap is the COVID-19 of Debian IMHO. Don't forget to wash your hands.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#9 Post by bester69 »

sunrat wrote:
Head_on_a_Stick wrote: I think so, yes. I'm just going from the man page. I don't use snap packages.
Snap is the COVID-19 of Debian IMHO. Don't forget to wash your hands.
I dont tend to wash my hands ..dont believe very much in invisible things, and mass.media thinking

only clean them when i see them dirty.. but I belong to old school mind, you know, just imagine how millons people lived like that in recent past, and nothing happend to them.. neither believe in climatic change and stuff like that.. thay're all patrañas and lies and mk-ultra throught tv news

if Coronavirus only kill old people (mortality rate 0,3% under 75yo), I dont get vey well , why so much scare, In SPain right now we're all happy wothout masks ans measures, propagating the virus throught whole territory :mrgreen: .. meanwhile in Japan and Italy .... :shock: :?
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: Hold Snap Application Update?

#10 Post by sunrat »

Now I know you are talking through your arse. The climate has changed markedly in my 65 years on the planet. And I will be careful to avoid Spain during my forthcoming Europe trip, and not because of any virus.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Hold Snap Application Update?

#11 Post by Dai_trying »

bester69 wrote:but I belong to old school mind, you know, just imagine how millons people lived like that in recent past, and nothing happend to them.. neither believe in climatic change and stuff like that.. thay're all patrañas and lies and mk-ultra throught tv news
Do the years 1918 to 1920 mean anything? (https://en.wikipedia.org/wiki/Spanish_flu)
excert from link wrote:The death toll is estimated to have been anywhere from 17 million to 50 million, and possibly as high as 100 million, making it one of the deadliest epidemics in human history

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 585
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 78 times
Been thanked: 89 times

Re: Hold Snap Application Update?

#12 Post by wizard10000 »

bester69 wrote:dont believe very much in invisible things
Gravity must be quite the mystery to you then.

Yeah, I know - don't feed the troll :mrgreen:
we see things not as they are, but as we are.
-- anais nin

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Hold Snap Application Update?

#13 Post by bester69 »

.
Last edited by bester69 on 2020-03-15 19:54, edited 1 time in total.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Hold Snap Application Update?

#14 Post by Head_on_a_Stick »

The NASA chiefs didn't believe in Relativity either until they realised they had to use Einstein's equations to stop their satellites from falling out of the sky: https://physicscentral.com/explore/writers/will.cfm

And in respect of Flat Earthers I highly recommend Behind The Curve, it's hilarious. Especially the bit at the end where their experiment to prove that Earth is flat does the exact opposite.

So is this thread [SOLVED] by your ludicrous scripts then? I can feel a lock coming on...
deadbang

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: [Fixed] Hold Snap Application Update?

#15 Post by bester69 »

Updated, and fixed..

snap installations are created as squashfs images, so the right way to protect it, would be protect parent folder app and squasfhfs image.:

To exclude opera (v67) of purging with snap refresh.:
sudo chattr +i /var/lib/snapd/snaps/opera_67.snap
sudo chattr +i /snap/opera/

/snap/opera$ ls -l
total 4
drwxr-xr-x 1 root root 0 feb 25 15:20 66
drwxr-xr-x 11 root root 144 mar 2 22:36 67
lrwxrwxrwx 1 root root 2 mar 7 03:59 current -> 67

update-snaps.sh

Code: Select all

#!/bin/bash
clear

#Hold 60 días
sudo snap set system refresh.hold="2029-04-23T17:22:54+01:00"
snap refresh --time
sudo chattr +i /var/lib/snapd/snaps/opera_67.snap
sudo chattr +i /snap/opera/

sleep 3

 
snap list | awk -F" " '{if ($1 && NR>1) { system("sudo snap refresh " $1 "") }}'

# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu

snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
    
    if [ "$snapname" == "opera" ]
    then
        :
    else
       sudo snap remove "$snapname" --revision="$revision"
    fi
     
    done
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

Post Reply