{"id":41858,"date":"2022-07-04T17:10:43","date_gmt":"2022-07-04T17:10:43","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=41858"},"modified":"2022-11-15T15:00:25","modified_gmt":"2022-11-15T15:00:25","slug":"delay-specify-update-snap-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/07\/delay-specify-update-snap-ubuntu\/","title":{"rendered":"How to Delay or Tell When to Update Snap Apps in Ubuntu"},"content":{"rendered":"<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-38838\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-logo.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a>\n<p><b>Ubuntu automatically checks and updates all installed Snap packages 4 times every day. Here&#8217;s how you can delay or assign a certain time period for the automatic update.<\/b><\/p>\n<p>Snap is an Ubuntu developed universal package format that runs in sandbox. Few core apps (such as Ubuntu Software and Firefox in 22.04) and many software in Ubuntu Software are Snap packages. Unlike classic <code>.deb<\/code> package, snap updates all the packages automatically in the background silently without user intervention.<\/p>\n<p>If you didn&#8217;t <a href=\"https:\/\/ubuntuhandbook.org\/index.php\/2022\/04\/remove-snap-block-ubuntu-2204\/\" target=\"_blank\" rel=\"noopener\">block the Snap package<\/a>, you must have some installed on your Ubuntu machine. And, to avoid conflict to daily work (e.g., online meetings, data backup), you may tell Snap when to do the updates.<\/p>\n<h3>Check when Snap will do updates:<\/h3>\n<p>By default, snap check (and install if any) updates 4 times per day. You may verify it by pressing <b>Ctrl+Alt+T<\/b> on keyboard to open terminal and run command:<\/p>\n<pre>snap refresh --time<\/pre>\n<p>Besides the time period and frequency, it also tells when the last done and next will occur.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-41860\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-refreshtime-600x172.webp\" alt=\"\" width=\"600\" height=\"172\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-refreshtime-600x172.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-refreshtime-300x86.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-refreshtime.webp 750w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Hold or Completely Disable Automatic Updates<\/h3>\n<p>The developer team finally added the <code>--hold<\/code> parameter, so user can hold updates for either certain app or all snaps for given time or indefinitely.<\/p>\n<p><i><b>NOTE: the commands below work only for edge channel of snapd daemon at the moment of writing.<\/b><\/i><\/p>\n<p>Simply open terminal and run command, and run command to hold updates for 24 hours via command:<\/p>\n<pre>snap refresh --hold=24h firefox<\/pre>\n<p>Or completely disable automatic updates for firefox via:<\/p>\n<pre>snap refresh --hold firefox<\/pre>\n<p>To disable automatic updates for all snap applications, run command:<\/p>\n<pre>snap refresh --hold<\/pre>\n<p>To re-enable automatic updates, use command to unhold all:<\/p>\n<pre>snap refresh --unhold<\/pre>\n<p>Or unhold specified app via command:<\/p>\n<p>pre&gt;snap refresh &#8211;unhold firefox<\/p>\n<a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43325\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold-600x258.webp\" alt=\"\" width=\"600\" height=\"258\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold-600x258.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold-300x129.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold-768x331.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-holdunhold.webp 783w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a>\n<h3>Specify time period for Snap update<\/h3>\n<p>To tell when and how often to check updates, it can be done by running a single command in terminal to set the value of &#8220;refresh.timer&#8221;.<\/p>\n<p>For example, to allow only between 4.00am and 6.00am, and 9.00pm and 12.00pm, use command:<\/p>\n<pre>sudo snap set system refresh.timer=4:00-6:00,21:00-24:00<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-41861\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/refresh-timer1-600x187.webp\" alt=\"\" width=\"600\" height=\"187\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/refresh-timer1-600x187.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/refresh-timer1-300x94.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/refresh-timer1.webp 750w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Or, only check\/install updates twice in weekend via command:<\/p>\n<pre>sudo snap set system refresh.timer=sat,sun,0:00-24:00\/2<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-41863\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-timer2-600x179.webp\" alt=\"\" width=\"600\" height=\"179\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-timer2-600x179.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-timer2-300x89.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-timer2-768x229.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/snap-timer2.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Other examples include between 10.00pm and 11.00pm from Monday to Wednesday, and between 9.00am and 11.00am on Friday.<\/p>\n<pre>sudo snap set system refresh.timer=mon-wed,22:00-23:00,,fri,9:00-11:00<\/pre>\n<p>Or second Monday of the month between 9:00 and 11:00 via command:<\/p>\n<pre>sudo snap set system refresh.timer=mon2,9:00-11:00<\/pre>\n<h3>Delay the update<\/h3>\n<p>Ubuntu supports to delay snap updates by specifying a value to &#8220;refresh.hold&#8221; up to 90 days.<\/p>\n<p>1. Firstly, in case you don&#8217;t know your time zone short name, run command:<\/p>\n<pre>date<\/pre>\n<p>It will output the current date and time, as well as time zone (e.g., NST, AST, EST, PST, CST).<\/p>\n<p>2. Next, use the command below to convert your desired time (e.g., July 7, 2022) to the right format:<\/p>\n<pre>date --date=\"<b>CST 2022-07-07 18:22:00<\/b>\" +%Y-%m-%dT%H:%M:%S%:z<\/pre>\n<p>Replace the time zone, date and time in bold. And, copy the output time for use in next command.<\/p>\n<p>3. Finally, delay snap refresh until the given date and time.<\/p>\n<pre>sudo snap set system refresh.hold=<b>2022-07-07T18:22:00+08:00<\/b><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-41866\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/delay-snaprefresh-600x407.webp\" alt=\"\" width=\"600\" height=\"407\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/delay-snaprefresh-600x407.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/delay-snaprefresh-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/delay-snaprefresh-768x521.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/07\/delay-snaprefresh.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>To verify the change, use command:<\/p>\n<pre>sudo snap get system refresh.hold<\/pre>\n<h3>Prevent update when on metered connections<\/h3>\n<p>If you&#8217;re running Ubuntu on a metered network connection. Which mean you have limited amount of data per month or day. You can prevent Snap from doing updates by running command:<\/p>\n<pre>sudo snap set system refresh.metered=hold<\/pre>\n<p>To undo this change, use command:<\/p>\n<pre>sudo snap set system refresh.metered=null<\/pre>","protected":false},"excerpt":{"rendered":"<p>Ubuntu automatically checks and updates all installed Snap packages 4 times every day. Here&#8217;s how you can delay or assign a certain time period for the automatic update. Snap is an Ubuntu developed universal package format that runs in sandbox. Few core apps (such as Ubuntu Software and Firefox in 22.04) and many software in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":38838,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"link","meta":{"footnotes":""},"categories":[9],"tags":[1494],"class_list":["post-41858","post","type-post","status-publish","format-link","has-post-thumbnail","hentry","category-howtos","tag-snap","post_format-post-format-link"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/41858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=41858"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/41858\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/38838"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=41858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=41858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=41858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}