Snap
Revision for “Snap” created on August 27, 2023 @ 11:32:54
Title | Snap |
---|---|
Content | <h2><span id="Synaptic_Package_Manager">Snap</span></h2>
<strong>Snap</strong> (sometimes referred to as <em>Snappy</em>) is a software deployment/package management utility built by Canonical and can be seen as an alternative/distant cousin to Apt & <a href="https://www.bodhilinux.com/w/synaptic-package-manager/">Synaptic Package Manager</a> and <a href="https://www.bodhilinux.com/w/flatpak/">Flatpak</a> (the RedHat Developed alternative to Snap). The software packages (called snaps) automatically update (you can change this) and as such enable you to always run the latest version of a snap. You don’t need to work about dependency conflicts either when updating since snap packages are isolated from the rest of your system. They have their own file system and can’t interfere with other apps on your PC/Laptop.
<strong>Caveat for use - Minimal Resource PCs/Laptops</strong>
It is currently understood that snapd / snaps sometimes use a sizable memory footprint (even when not in use). If you are using a PC/laptop with only the minimal Bodhi Linux specifications, the memory demands may overwhelm your available system resources and as such your experience may not be optimal. An article on this subject was published <a href="https://www.omgubuntu.co.uk/2020/10/gnome-software-uses-lots-of-memory">here</a>.
<h3>Enabling snaps on Bodhi Linux 6 and 7</h3>
<code>snapd</code> is a REST API daemon for managing snap packages. This must be installed before other <em>Snaps</em> can be installed. However, snap support is disabled by default in Bodhi Linux 6 and 7. The apt package manager has been configured to prevent the installation of the snapd package, disabling the installation of all snap packages on Bodhi. The Bodhi Team felt this was necessary due to changes in the way Ubuntu packages certain applications in the Ubuntu repositories. Linux Mint made the same decision.
<a href="https://blog.linuxmint.com/?p=3766">As explained</a> by Mint's lead developer, Clem Lefebvre:
<blockquote>as you install APT updates, Snap becomes a requirement for you to continue to use Chromium and installs itself behind your back. This breaks one of the major worries many people had when Snap was announced and a promise from its developers that it would never replace APT.
A self-installing Snap Store which overwrites part of our APT package base is a complete NO NO.</blockquote>
If you decide you wish to install snap applications, here is how to enable the snap support in Bodhi Linux.
<code>sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update</code>
<h3>Installing Snapd</h3>
If the installation of <code>snapd</code>is enabled, then you can install <code>snapd</code> via <a href="https://www.bodhilinux.com/w/synaptic-package-manager/">Synaptic Package Manager</a>, or via apt through <a href="https://www.bodhilinux.com/w/terminology/">Terminology</a>. the latter is shown below.
<pre>sudo apt update && sudo apt install snapd</pre>
<h3>Installing the Snap Store (optional)</h3>
The snap store is a graphical tool to browse, select, and install <em>snaps.</em> You can install <code>snap-store</code> via <a href="https://www.bodhilinux.com/w/synaptic-package-manager/">Synaptic Package Manager,</a> or via apt through <a href="https://www.bodhilinux.com/w/terminology/">Terminology</a>. the latter is shown below.
<pre>sudo snap install snap-store</pre>
Once installed, the Snap Store can be found using the Bodhi Menu:
<p style="padding-left: 30px;">Main Menu > Applications > Internet > Snap Store</p>
<p style="padding-left: 30px;"><strong>NOTE</strong>: if you do not see the menu entry, you may be required to reboot for the app to be picked up and added to the Moksha menu).</p>
Use the snap store to search for and/or browse for snaps by category. Each snaps page has a dedicated page housing more information plus the option to install the targeted software.
<h3>Snaps Management - command-line</h3>
All the following commands are run at the command line using <a href="https://www.bodhilinux.com/w/terminology/"><em>Terminology</em></a>
<h4>Search for Packages</h4>
To find your package/software:
<pre>snap find <search_text></pre>
<a href="https://www.bodhilinux.com/trial/wp-content/uploads/2020/11/SnapSearch.png?x55737&x58022&x58022&x58022"><img class="aligncenter wp-image-3619" src="https://www.bodhilinux.com/trial/wp-content/uploads/2020/11/SnapSearch-620x277.png?x55737&x58022&x58022&x58022" alt="snap Search" width="199" height="89" /></a>
<h4>Install a Package</h4>
To find your package/software:
<pre>sudo snap install <package></pre>
<a href="https://www.bodhilinux.com/trial/wp-content/uploads/2020/11/SnapInstall.png?x55737&x58022&x58022&x58022"><img class="aligncenter size-medium wp-image-3620" src="https://www.bodhilinux.com/trial/wp-content/uploads/2020/11/SnapInstall-620x73.png?x55737&x58022&x58022&x58022" alt="snap Install" width="620" height="73" /></a>
<h4>List Installed Packages</h4>
<pre>snap list --all --color auto</pre>
<h4>Update a Package</h4>
<pre>sudo snap refresh <package-name></pre>
<h4>Update All Packages</h4>
<pre>sudo snap refresh --list</pre>
<h4>Remove a Package</h4>
<pre>sudo snap remove <package-name></pre>
<h3>Completely Remove Snaps/Snapd</h3>
Using <a href="#Snaps_Management_8211_command-line">Snap Management - Command-line</a> as a guide, perform the following steps using <a href="https://www.bodhilinux.com/w/terminology/"><em>Terminology</em></a>:
<ol>
<li><strong>List Install Packages</strong>
<code>snap list --all --color auto</code></li>
<li><strong>Remove all Packages</strong>. For each item listed in the output of step #1, run
<code>sudo snap remove <package-name></code></li>
<li><strong>Remove Snapd</strong>
<code>sudo apt purge snapd</code></li>
<li><strong>Remove the snap folder</strong>
<code>rm -rf ~/snap</code></li>
<li><strong>Remove snap .desktop file(s)</strong>
<code>rm ~/.local/share/applications/snap*
rm ~/Desktop/snap*</code></li>
</ol>
<a href="https://www.bodhilinux.com/">Bodhi Linux Home</a>
<a href="https://www.bodhilinux.com/w/wiki/">Bodhi Linux – Wiki Home Page</a>
<a href="https://www.bodhilinux.com/w/bodhi-linux-how-to/">Bodhi Linux – Wiki Table of Contents</a> |
Excerpt |