{"id":33288,"date":"2021-01-25T16:53:21","date_gmt":"2021-01-25T16:53:21","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=33288"},"modified":"2024-04-24T15:06:50","modified_gmt":"2024-04-24T15:06:50","slug":"earch-install-remove-snap-apps-command-line","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2021\/01\/earch-install-remove-snap-apps-command-line\/","title":{"rendered":"How to Search, Install, Remove Snap Apps in Command Line"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-9572\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2019\/11\/snapcraft-icon.png\" alt=\"\" width=\"245\" height=\"250\" \/><\/p>\n<p>This simple tutorial shows how to search for, install, remove, and list installed Snap applications in Ubuntu from command line.<\/p>\n<p>Snap is an universal Linux package format developed by Canonical, the company behind Ubuntu. <i>Though many users hate the Snap apps<\/i>, it&#8217;s hard to keep away from it since many popular applications (e.g., <b>VLC<\/b>, <b>Spotify<\/b>, <b>VS Code<\/b>, <b>Android Studio<\/b>) offer official Ubuntu binaries through Snap rather than classic deb package.<\/p>\n<p>As Ubuntu Software still sucks and does not load application pages quite often, you can run followings command instead to search for &amp; install snap applications.<\/p>\n<h4>1. Searching for Snap Apps in Terminal:<\/h4>\n<p>Simply open terminal from system application launcher. You can then either run <code style=\"border: none;\">snap find<\/code> or <code style=\"border: none;\">snap search<\/code> command follow with app name to query the store for available packages.<\/p>\n<p>Both commands below do the same searching for GIMP packages:<\/p>\n<pre style=\"border: none;\">snap find gimp\r\n\r\nsnap search gimp<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33289\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-search.png\" alt=\"\" width=\"600\" height=\"388\" \/><\/p>\n<p>For the verified publisher, you&#8217;ll see a green check mark after the publisher name.<\/p>\n<h4>2. Command to Install a Snap App:<\/h4>\n<p>To install a Snap application package, simply run <code style=\"border: none;\">snap install<\/code> command follow with the package name.<\/p>\n<p>After searching for an app, you can then select install one from available packages by running command (VLC for instance):<\/p>\n<pre style=\"border: none;\">snap install vlc<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33290\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-install-vlc.png\" alt=\"\" width=\"600\" height=\"171\" \/><\/p>\n<p>Some applications support for installing with <code style=\"border: none;\">--classic<\/code> flag to access files outside user&#8217;s home directory. So, the command could be:<\/p>\n<pre>snap install vlc --classic<\/pre>\n<p>Usually, we install Snap applications from the stable channel. There are also <code>beta<\/code>, <code>edge<\/code>, <code>candidate<\/code> channels include packages for testing purpose. For example, install VLC from its Beta channel, use command:<\/p>\n<pre>snap install vlc --channel beta<\/pre>\n<h4>3. How to List installed Snap applications:<\/h4>\n<p>To list all installed snap applications, simply run <code style=\"border: none;\">snap list<\/code> in terminal.<\/p>\n<pre style=\"border: none;\">snap list<\/pre>\n<p>While &#8220;core&#8221; and &#8220;core18&#8221; are snap core packages, &#8220;snap-store&#8221;, &#8220;snap-store-proxy&#8221;, and &#8220;snap-store-proxy-client&#8221; relates to the Ubuntu Software.<br \/>\nAll others are user installed packages, though &#8220;gnome-3-xxx&#8221; packages were installed automatically as dependency platform.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33291\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-list.png\" alt=\"\" width=\"600\" height=\"295\" \/><\/p>\n<p>Snap apps update automatically when new release packages published. So, there may be old packages present in your system after using them for a period of time. <b>To list all of them<\/b>, use command:<\/p>\n<pre>snap list --all<\/pre>\n<p>Old packages should be marked as &#8216;disabled&#8217;.<\/p>\n<h4>4. How to Remove Snap Apps via command:<\/h4>\n<p>To remove a snap package, simply run <code>snap remove<\/code> command follow with package name.<\/p>\n<p>In the case, I&#8217;m going to remove VLC snap package via command:<\/p>\n<pre style=\"border: none;\">snap remove vlc<\/pre>\n<p>NOTE that the dependency platform (e.g., gnome and wine) won&#8217;t to be removed while removing the snap that requires it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-33292\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-vlc.png\" alt=\"\" width=\"600\" height=\"150\" \/><\/p>\n<p>The previous remove command will leave a snapshot of app data on your system. Use <code>--purge<\/code> flag will clear all the app data:<\/p>\n<pre>snap remove --purge vlc<\/pre>\n<p>By running <code>snap list --all<\/code> command in terminal, you may see some old versions of app packages left in system marked as &#8220;disabled&#8221;. To remove one of the disabled package, there&#8217;s a &#8216;<code>revision<\/code>&#8216; flag can do the job. For example, remove chromium marked as rev 2254:<\/p>\n<pre>snap remove chromium --revision=2254<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-43625\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision-600x232.webp\" alt=\"\" width=\"600\" height=\"232\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision-600x232.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision-300x116.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision-768x297.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/01\/snap-remove-revision.webp 1086w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Thanks to <i>@Fernando<\/i>, the command below will free up disk space by removing all the old disabled snap packages:<\/p>\n<pre>snap list --all | awk '\/disabled\/{system(\"sudo snap remove \" $1 \" --revision=\" $3)}'<\/pre>\n<h4>Summary:<\/h4>\n<p>In brief you can run <b>snap find APP_NAME<\/b> or <b>snap search APP_NAME<\/b> to search for available packages. Use <b>snap install PACKAGE_NAME<\/b> or <b>snap remove PACKAGE_NAME<\/b> to install or remove an application. And run <b>snap list<\/b> to list all installed snap applications.<\/p>","protected":false},"excerpt":{"rendered":"<p>This simple tutorial shows how to search for, install, remove, and list installed Snap applications in Ubuntu from command line. Snap is an universal Linux package format developed by Canonical, the company behind Ubuntu. Though many users hate the Snap apps, it&#8217;s hard to keep away from it since many popular applications (e.g., VLC, Spotify, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[1494],"class_list":["post-33288","post","type-post","status-publish","format-standard","hentry","category-command-skills","tag-snap"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33288","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=33288"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/33288\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=33288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=33288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=33288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}