Difference between revisions of "Snapcraft"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
m
m (see also)
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
 
SNAP
 
SNAP
  
Snapcraft is touted to be a special jailed development environment.  Snapcraft or simply snap is a self-contained way of packaging software that enables independent software installation. Everything that is needed to run an application is part of the snap package, so there are no external dependencies outside the snap package and no dependency with the application repository. The tool for using snaps is called snapd (the Snapcraft daemon), which must be installed first.
+
Snapcraft is touted to be a special jailed development environment.  Snapcraft or simply snap is a self-contained way of packaging software that enables independent software installation. Everything that is needed to run an application is part of the snap package, so there are no external dependencies outside the snap package and no dependency with the application repository. The tool for using snaps is called snapd (the Snapcraft daemon), which must be installed first.  Once installed, you have yet another daemon, aka background process running full time sharing resources with everything else you are trying to do on your computer.
  
However, using snap requires to run it as root.  The self contained nature of snap results in wasted disk space as libraries are redundantly added to many snaps, identical to each other rather than being shared.  Snaps are by and large flaky and many times seem to be broken.
+
Using snap requires to run it as root which seems to negative any security advantage.  The self contained nature of snap results in wasted disk space as libraries are redundantly added to many snaps, identical to each other rather than being shared.  Snaps are by and large flaky and many times seem to be broken.
  
 
Snap is not completely open source as a lot of people may think, the server-side is completely proprietary also is the audit part.  Snaps have built-telemetry, this is how they know how many and what distributions are using snap.
 
Snap is not completely open source as a lot of people may think, the server-side is completely proprietary also is the audit part.  Snaps have built-telemetry, this is how they know how many and what distributions are using snap.
  
 
The Linux Mint team doesn't care much for snaps, but it's still possible to install them.
 
The Linux Mint team doesn't care much for snaps, but it's still possible to install them.
* https://blog.linuxmint.com/?p=3906
+
* [https://blog.linuxmint.com/?p=3906 Read: The Linux Mint Blog Monthly News – May 2020]
  
 
The snap back end (snap store) is still proprietary and only controlled by Canonical/Ubuntu. Canonical has also been forcing snaps instead of regular apt packages on Ubuntu.  Snaps are slow to install, slow to start, take too much RAM, too much disk space and they auto-update themselves without asking.   
 
The snap back end (snap store) is still proprietary and only controlled by Canonical/Ubuntu. Canonical has also been forcing snaps instead of regular apt packages on Ubuntu.  Snaps are slow to install, slow to start, take too much RAM, too much disk space and they auto-update themselves without asking.   
  
 
Ultimately it is best to AVOID using snapcraft.  If there are alternatives to a snap package for a software such as a debian package or source you are better off avoiding the snap route.   
 
Ultimately it is best to AVOID using snapcraft.  If there are alternatives to a snap package for a software such as a debian package or source you are better off avoiding the snap route.   
 +
 +
* Starting from Ubuntu 20.04 there are several snap packages that replace the previous binaries and the installation of the new software gives the priority to the Snap system.  Ubuntu is FORCING SNAP ON USERS.  Starting with Ubuntu 16.04 LTS (Xenial Xerus) and later the Ubuntu system has Snap by default.
 +
 +
* Ubuntu systems now install and enable snapcraft aka snap by default.  It is a fact that the performance worsens with snaps, so why force the hand by forcing users to use this technology. The packages called snaps, and the tool for using them, snapd are now part of Ubuntu.  The overall user experience with Snaps on Ubuntu is frustrating: several apps won’t start when installed as snaps, others run weird, others take really long time to start.
 +
 +
* Chromium has been only packaged as a snap and is an example of the poor direction snap is taking linux. Snap becomes a requirement for you to continue to use Chromium and installs itself behind your back.  The Chromium package is indeed empty and acting, without your consent, as a backdoor by connecting your computer to the Ubuntu Store. Applications in this store cannot be patched, or pinned. You can’t audit them, hold them, modify them or even point snap to a different store.
  
 
== Install ==
 
== Install ==
Line 60: Line 66:
  
 
Also, you need to reboot now that you mucked about with your kernel.
 
Also, you need to reboot now that you mucked about with your kernel.
 +
 +
== Snap Commands ==
 +
 +
list all the existing snap packages
 +
snap list
 +
 +
remove the snap package
 +
sudo snap remove <name-of-the-package>
 +
 +
remove the snap-store package (you can’t remove the ‘core’ snap package with sudo snap remove core)
 +
sudo snap remove snap-store
 +
 +
== Uninstall and Remove Snap ==
 +
First you have to unmount snap, much as you would unmount a drive.  Find out what is mounted via different ways, here are some examples
 +
mount|grep snap.core
 +
df|grep snap.core
 +
 +
Unmount snap core
 +
sudo umount /snap/snapd/0000
 +
 +
You won't use 0000 rather instead the number of the ID you gleaned by using the mount or df command in the above example.  There will likely be more than one core mounted. 
 +
 +
 +
to remove and purge the snapd package and all of its related services
 +
sudo apt purge snapd
 +
 +
to remove all the folder related to snap, if existing
 +
sudo rm -rf ~/snap /snap /var/snap /var/lib/snapd
 +
 +
== see also ==
 +
* [https://cialu.net/a-better-ubuntu-linux-without-the-crappy-snap/ A better Ubuntu Linux without the crappy Snap]
 +
* [https://erietz.github.io/posts/2021-08-14-snapd.html snaps a joke and you should just use the package manager]
 +
 +
[[Category:Computer_Technology]]
 +
[[Category:Linux]]

Latest revision as of 20:47, 17 October 2022

SNAP

Snapcraft is touted to be a special jailed development environment. Snapcraft or simply snap is a self-contained way of packaging software that enables independent software installation. Everything that is needed to run an application is part of the snap package, so there are no external dependencies outside the snap package and no dependency with the application repository. The tool for using snaps is called snapd (the Snapcraft daemon), which must be installed first. Once installed, you have yet another daemon, aka background process running full time sharing resources with everything else you are trying to do on your computer.

Using snap requires to run it as root which seems to negative any security advantage. The self contained nature of snap results in wasted disk space as libraries are redundantly added to many snaps, identical to each other rather than being shared. Snaps are by and large flaky and many times seem to be broken.

Snap is not completely open source as a lot of people may think, the server-side is completely proprietary also is the audit part. Snaps have built-telemetry, this is how they know how many and what distributions are using snap.

The Linux Mint team doesn't care much for snaps, but it's still possible to install them.

The snap back end (snap store) is still proprietary and only controlled by Canonical/Ubuntu. Canonical has also been forcing snaps instead of regular apt packages on Ubuntu. Snaps are slow to install, slow to start, take too much RAM, too much disk space and they auto-update themselves without asking.

Ultimately it is best to AVOID using snapcraft. If there are alternatives to a snap package for a software such as a debian package or source you are better off avoiding the snap route.

  • Starting from Ubuntu 20.04 there are several snap packages that replace the previous binaries and the installation of the new software gives the priority to the Snap system. Ubuntu is FORCING SNAP ON USERS. Starting with Ubuntu 16.04 LTS (Xenial Xerus) and later the Ubuntu system has Snap by default.
  • Ubuntu systems now install and enable snapcraft aka snap by default. It is a fact that the performance worsens with snaps, so why force the hand by forcing users to use this technology. The packages called snaps, and the tool for using them, snapd are now part of Ubuntu. The overall user experience with Snaps on Ubuntu is frustrating: several apps won’t start when installed as snaps, others run weird, others take really long time to start.
  • Chromium has been only packaged as a snap and is an example of the poor direction snap is taking linux. Snap becomes a requirement for you to continue to use Chromium and installs itself behind your back. The Chromium package is indeed empty and acting, without your consent, as a backdoor by connecting your computer to the Ubuntu Store. Applications in this store cannot be patched, or pinned. You can’t audit them, hold them, modify them or even point snap to a different store.

Install

 sudo apt install snapd

As a side effect of using --devmode the snap will not automatically update. In order to update to a newer version you can run:

$ snap refresh --beta --devmode <<name of software>>


Example SNAP software

Is it installed or what about it?

snap info <<softwarename>>


vlc

Check this out...

anbox

anbox - Android emulator. Anbox puts the Android operating system into a container, abstracts hardware access and integrates core system services into a GNU/Linux system.

I tried to install it one way, and on Mint 18 it failed, so I tired another way... see below...

nicolep@solo ~/tmp $ snap install --classic anbox-installer && anbox-installer
anbox-installer 1 from morphis installed
The anbox-installer is deprecated. Please find updated installation
instructions here https://github.com/anbox/anbox/blob/master/docs/install.md
For any further questions please ask on the #anbox IRC channel on the
FreeNode network or in the Anbox telegram group (https://t.me/anbox).
nicolep@solo ~/tmp $ snap install --devmode --beta anbox
anbox (beta) 4-e1ecd04 from morphis installed

I don't know, maybe that helps you. Try it both ways.

You need some kernel stuff

sudo add-apt-repository ppa:morphis/anbox-support
sudo apt install anbox-modules-dkms
sudo modprobe ashmem_linux
sudo modprobe binder_linux
sudo apt-get install android-tools-adb

Oh I guess snap isn't so great after all, I still need to manually add kernel modules!!!!

Also, you need to reboot now that you mucked about with your kernel.

Snap Commands

list all the existing snap packages

snap list

remove the snap package

sudo snap remove <name-of-the-package>

remove the snap-store package (you can’t remove the ‘core’ snap package with sudo snap remove core)

sudo snap remove snap-store

Uninstall and Remove Snap

First you have to unmount snap, much as you would unmount a drive. Find out what is mounted via different ways, here are some examples

mount|grep snap.core
df|grep snap.core

Unmount snap core

sudo umount /snap/snapd/0000

You won't use 0000 rather instead the number of the ID you gleaned by using the mount or df command in the above example. There will likely be more than one core mounted.


to remove and purge the snapd package and all of its related services

sudo apt purge snapd

to remove all the folder related to snap, if existing

sudo rm -rf ~/snap /snap /var/snap /var/lib/snapd

see also