{"id":38836,"date":"2022-04-18T14:09:49","date_gmt":"2022-04-18T14:09:49","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=38836"},"modified":"2024-05-03T01:20:17","modified_gmt":"2024-05-03T01:20:17","slug":"remove-snap-block-ubuntu-2204","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/04\/remove-snap-block-ubuntu-2204\/","title":{"rendered":"How to Remove &#038; Block Snap Apps in Ubuntu 22.04 &#038; 24.04"},"content":{"rendered":"<p><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><\/p>\n<p>Ubuntu is distributing more applications as the universal Snap package, but some users don&#8217;t like them. So I&#8217;m writing this tutorial for those want to completely get rid of Snap and prevent it from being installed back.<\/p>\n<p><b>NOTE 1: Before getting started, please backup your app data, e.g., Firefox bookmarks. Attention that Ubuntu Software and App Center will also be removed after following this tutorial.<\/b><br \/>\n<b>NOTE 2: This tutorial is tested and works in Ubuntu 22.04 and Ubuntu 24.04. It should also work on official flavors, e.g, XUbuntu, KUbuntu, etc.<\/b><\/p>\n<h3>Step 1. Remove Snap apps and the Daemon<\/h3>\n<p>Press <b>Ctrl+Alt+T<\/b> on keyboard to open a terminal window. When it opens, run the commands below one by one.<\/p>\n<p>1.) List all installed snap applications:<\/p>\n<pre>snap list<\/pre>\n<p>They are by default Snap Store (Ubuntu Software), Firefox, default theme, and few core packages.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-38839\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-list-600x406.webp\" alt=\"\" width=\"600\" height=\"406\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-list-600x406.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-list-300x203.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-list-768x520.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/snap-list.webp 840w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>2.) Remove the apps one by one, Firefox and Snap-store go first, then theme package, gnome platform (in sandbox), and finally base packages and snapd daemon. NOTE: the package names may vary depends on &#8220;snap list&#8221; output.<\/p>\n<pre>sudo snap remove --purge firefox<\/pre>\n<pre>sudo snap remove --purge snap-store<\/pre>\n<pre>sudo snap remove --purge gnome-3-38-2004<\/pre>\n<p>Also run <code>snap remove<\/code> command to remove &#8220;gtk-common-themes&#8221;, &#8220;snapd-desktop-integration&#8221;, &#8220;bare&#8221;, &#8220;core20&#8221;, and finally &#8220;snapd&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-38840\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages-600x342.webp\" alt=\"\" width=\"600\" height=\"342\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages-600x342.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages-300x171.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages-768x438.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snappackages.webp 777w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>3.) Finally remove the Snap daemon package via apt:<\/p>\n<pre>sudo apt remove --autoremove snapd<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-38841\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd-600x342.webp\" alt=\"\" width=\"600\" height=\"342\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd-600x342.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd-300x171.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd-768x438.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/remove-snapd.webp 777w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>Step 2. Block Snap package<\/h3>\n<p>After completely removed snap packages, you may prevent Ubuntu from installing them back by settings low priority for the <code>Snapd<\/code> package. Here&#8217;s how to do the trick inspired by the way Linux Mint 20 did.<\/p>\n<p>1.) Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to create and open a configuration file:<\/p>\n<pre>sudo gedit \/etc\/apt\/preferences.d\/nosnap.pref<\/pre>\n<p><b>For Ubuntu 24.04, replace <code>gedit<\/code> with <code>gnome-text-editor<\/code>. For non-GNOME desktop, use your system text editor or <code>nano<\/code> (Ctrl+S to save, and Ctrl+X to exit) that works for all.<\/b><br \/>\nWhen the file opens, paste lines below to tell refuse <code>snapd<\/code> from any repository:<\/p>\n<blockquote><p># To prevent repository packages from triggering the installation of snap,<br \/>\n# this file forbids snapd from being installed by APT.<\/p>\n<p>Package: snapd<br \/>\nPin: release a=*<br \/>\nPin-Priority: -10<\/p><\/blockquote>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-38842\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref-600x247.webp\" alt=\"\" width=\"600\" height=\"247\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref-600x247.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref-300x123.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref-768x316.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/nosnap-pref.webp 808w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>2. After save the file, refresh package cache via command:<\/p>\n<pre>sudo apt update<\/pre>\n<p>Now, whenever you try to installed a Snap package or the daemon, it outputs either unmet dependencies (snapd) or package has no installation candidate.<\/p>\n<h3>How to Restore:<\/h3>\n<p>If you change your mind, run the commands below at any time will install back the Snap apps.<\/p>\n<p>Firstly, run command in terminal (Ctrl+Alt+T) to unblock the daemon:<\/p>\n<pre>sudo rm \/etc\/apt\/preferences.d\/nosnap.pref<\/pre>\n<p>Then, install Ubuntu Software via command:<\/p>\n<pre>sudo snap install snap-store<\/pre>\n<p>And install Firefox as snap if you want by running command:<\/p>\n<pre>sudo apt install firefox<\/pre>","protected":false},"excerpt":{"rendered":"<p>Ubuntu is distributing more applications as the universal Snap package, but some users don&#8217;t like them. So I&#8217;m writing this tutorial for those want to completely get rid of Snap and prevent it from being installed back. NOTE 1: Before getting started, please backup your app data, e.g., Firefox bookmarks. Attention that Ubuntu Software and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":38838,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1494],"class_list":["post-38836","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-snap"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/38836","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=38836"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/38836\/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=38836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=38836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=38836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}