{"id":659,"date":"2022-06-17T10:20:50","date_gmt":"2022-06-17T17:20:50","guid":{"rendered":"https:\/\/jasonsblog.access.ly\/?p=659"},"modified":"2022-11-05T07:44:40","modified_gmt":"2022-11-05T14:44:40","slug":"btop-system-monitor-installation-using-snap","status":"publish","type":"post","link":"https:\/\/jasonsblog.ddns.net\/index.php\/2022\/06\/17\/btop-system-monitor-installation-using-snap\/","title":{"rendered":"BTOP System Monitor Installation using Snap"},"content":{"rendered":"\n<p>On several of my Linux operating systems I found that <a aria-label=\"BTOP++ (opens in a new tab)\" href=\"https:\/\/github.com\/aristocratos\/btop\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Btop++<\/a> wasn&#8217;t in the repositories, but was available via Snap package. Consequently, I only recently started using Snap after Ubuntu only included Firefox via Snap package. Snap is an interesting way to package an application with it&#8217;s libraries in a <a aria-label=\"SquashFS (opens in a new tab)\" href=\"https:\/\/en.wikipedia.org\/wiki\/SquashFS\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">SquashFS<\/a> file system with metadata in a single file, .snap, which is later decompressed and attached to the Linux file system. This allows the application to use specific libraries and avoids conflicts with other library versions in Linux maintained by the OS package manager. Also, this is in a sense a virtualized application that is sandboxed from the host operating system with its own file system and limited access to the host via interfaces with access to the host kernel using the <a href=\"https:\/\/en.wikipedia.org\/wiki\/AppArmor\" target=\"_blank\" aria-label=\"AppArmor Linux kernel security module (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">AppArmor Linux kernel security module<\/a>. This is similar to how Docker works and with other systems like <a aria-label=\"AppImage (opens in a new tab)\" href=\"https:\/\/appimage.org\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">AppImage<\/a> and <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/flatpak.org\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"ek-link\">Flatpak<\/a>. <\/p>\n\n\n\n<p>To install Snap on Debian or Ubuntu systems:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install snapd<\/code><\/pre>\n\n\n\n<p>To install Snap on an Manjaro:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pacman -S snapd<\/code><\/pre>\n\n\n\n<p>To install Snap on a Redhat based system, e.g. Fedora, Alma, Rocky:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install snapd<\/code><\/pre>\n\n\n\n<p>Once installed activate in systemd:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable snapd --now<\/code><\/pre>\n\n\n\n<p>And now you can use Snap and check the version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>snap --version<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"225\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_102029.png\" alt=\"\" class=\"wp-image-1791\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_102029.png 755w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_102029-300x89.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p>Search for package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>snap find btop<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"167\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103716.png\" alt=\"\" class=\"wp-image-1790\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103716.png 792w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103716-300x63.png 300w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103716-768x162.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/figure>\n\n\n\n<p>Get verbose info on btop which will show author, confinement of virtual environment and available channels&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>snap info btop --verbose<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"665\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103823.png\" alt=\"\" class=\"wp-image-1789\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103823.png 882w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103823-300x226.png 300w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_103823-768x579.png 768w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<p>Now we can install btop++ and run our Snap app in Debian or Ubuntu:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap install btop<\/code><\/pre>\n\n\n\n<p>And once installed we can run btop and enjoy a much improved system monitor. One note, you may have to logout and back in for the path to snap apps to be picked up, or run from the file location.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/snap\/bin\/btop<\/code><\/pre>\n\n\n\n<p>And here we see Btop++ running on my Raspberry Pi 4 Bitcoin\/Lightning Node:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"772\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_104504-1024x772.png\" alt=\"\" class=\"wp-image-1788\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_104504-1024x772.png 1024w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_104504-300x226.png 300w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_104504-768x579.png 768w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_104504.png 1130w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you get an error trying to run the application, you may need to update the core package with the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap install core<\/code><\/pre>\n\n\n\n<p>According to the documentation snapd is supposed to check for updates and apply them on its own. I find that it doesn&#8217;t, but I mostly run my Linux desktops in virtualization on demand so I just include a Snap refresh with my system update commands when I login.<\/p>\n\n\n\n<p>For Debian\/Ubuntu:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt dist-upgrade &amp;&amp; sudo snap refresh<\/code><\/pre>\n\n\n\n<p>Manjaro:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pacman -Syyuu &amp;&amp; sudo snap refresh<\/code><\/pre>\n\n\n\n<p>Fedora\/Alma\/Rocky:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update &amp;&amp; sudo snap refresh<\/code><\/pre>\n\n\n\n<p>If you wanted to remove Btop++:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo snap remove btop<\/code><\/pre>\n\n\n\n<p>To list what Snap packages are installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>snap list<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"193\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_105705.png\" alt=\"\" class=\"wp-image-1787\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_105705.png 621w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2022\/11\/Screenshot_20220617_105705-300x93.png 300w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/figure>\n\n\n\n<p>Now Snap was created by Canonical for Linux kernel systems primarily for their Ubuntu systems, but it has been picked up by other distros. The major complaint is that the Ubuntu Snap store is closed source per the Wikipedia Receptions section:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Some developers have praised Snap.[83] Heroku said Snap auto-update fits their fast release schedule well, Microsoft mentioned its ease of use and being YAML-based, as well as it being distribution-agnostic, and JetBrains said the Snap Store gives their tools more exposure.<\/p>\n\n\n\n<p>Others have objected to the closed-source nature of the Snap Store. Clement Lefebvre (Linux Mint founder and project leader[84][85]) has written that Snap is biased and has a conflict of interest. The reasons he cited include it being governed by Canonical and locked to their store, and also that Snap works better on Ubuntu than on other distributions.[86] He later announced that the installing of Snap will be blocked,[87] although a way to disable this restriction will be documented.[88] <\/p>\n<cite><a href=\"https:\/\/en.wikipedia.org\/wiki\/Snap_(software)\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">https:\/\/en.wikipedia.org\/wiki\/Snap_(software)<\/a><\/cite><\/blockquote>\n\n\n\n<p>And with docker or running any other type of already prepared virtualization, you&#8217;ll want to be conscious of the creator. The Snap Store does an automated scan for malware and check of the packages, but something could still be slipped in. But at least your host has some protection from what the software is allowed to do. There was one case where an author in 2018 slipped some cryptocurrency mining code into a couple packages, but they were taken down and transferred to another author to create and manage those packages. And you can use <a href=\"https:\/\/snapcraft.io\/docs\/snapcraft-overview\" target=\"_blank\" aria-label=\"snapcraft (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">snapcraft<\/a> to create your own packages.<\/p>\n\n\n\n<p>Official documentation: <a href=\"https:\/\/snapcraft.io\/docs\/getting-started\">https:\/\/snapcraft.io\/docs\/getting-started<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On several of my Linux operating systems I found that Btop++ wasn&#8217;t in the repositories, but was available via Snap package. Consequently, I only recently started using Snap after Ubuntu only included Firefox via Snap package. Snap is an interesting way to package an application with it&#8217;s libraries in a SquashFS file system with metadata [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-659","post","type-post","status-publish","format-standard","hentry","category-tech"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_src":null,"author_info":{"display_name":"Jason","author_link":"https:\/\/jasonsblog.ddns.net\/index.php\/author\/jturning\/"},"_links":{"self":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/comments?post=659"}],"version-history":[{"count":6,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/659\/revisions"}],"predecessor-version":[{"id":1895,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/659\/revisions\/1895"}],"wp:attachment":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/media?parent=659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/categories?post=659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/tags?post=659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}