HOME

TheInfoList



OR:

Snap is a software packaging and
deployment Deployment may refer to: Engineering and software Concepts * Blue-green deployment, a method of installing changes to a web, app, or database server by swapping alternating production and staging servers * Continuous deployment, a software ...
system developed by
Canonical The adjective canonical is applied in many contexts to mean "according to the canon" the standard, rule or primary source that is accepted as authoritative for the body of knowledge or literature in that context. In mathematics, "canonical exampl ...
for operating systems that use the Linux kernel and the systemd init system. The packages, called ''snaps'', and the tool for using them, ''snapd'', work across a range of
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s and allow
upstream Upstream may refer to: * Upstream (bioprocess) * ''Upstream'' (film), a 1927 film by John Ford * Upstream (networking) * ''Upstream'' (newspaper), a newspaper covering the oil and gas industry * Upstream (petroleum industry) * Upstream (software ...
software developers to distribute their applications directly to users. Snaps are self-contained applications running in a sandbox with mediated access to the host system. Snap was originally released for cloud applications but was later ported to also work for Internet of Things devices and desktop applications.


Functionality


Snap Store

The Snap Store allows developers to publish their snap-packaged applications. All apps uploaded to the Snap Store undergo automatic testing, including a malware scan. However, the scan does not catch all issues. In one case in May 2018, two applications by the same developer were found to contain a
cryptocurrency A cryptocurrency, crypto-currency, or crypto is a digital currency designed to work as a medium of exchange through a computer network that is not reliant on any central authority, such as a government or bank, to uphold or maintain it. It i ...
miner which ran in the background during application execution. When this issue was found, Canonical removed the applications from the Snap Store and transferred ownership of the Snaps to a trusted third-party which re-published the Snaps without the miner present. Although the Snap sandbox reduces the impact of a malicious app, Canonical recommends users only install Snaps from publishers trusted by the user.


Universal Linux packages

''Snaps'' are
self-contained Self-sustainability and self-sufficiency are overlapping states of being in which a person or organization needs little or no help from, or interaction with, others. Self-sufficiency entails the self being enough (to fulfill needs), and a self-s ...
packages that work across a range of
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s. This is unlike traditional Linux package management approaches, which require specifically adapted packages for each Linux distribution. The snap file format is a single compressed
filesystem In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
using the SquashFS format with the extension .snap. This filesystem contains the application, libraries it depends on, and declarative metadata. This metadata is interpreted by snapd to set up an appropriately shaped secure
sandbox A sandbox is a sandpit, a wide, shallow playground construction to hold sand, often made of wood or plastic. Sandbox or Sand box may also refer to: Arts, entertainment, and media * Sandbox (band), a Canadian rock music group * ''Sand ...
for that application. After installation, the snap is mounted by the host operating system and decompressed on the fly when the files are used. Although this has the advantage that snaps use less disk space, it also means some large applications start more slowly. A significant difference between Snap and other universal Linux packaging formats such as Flatpak is that Snap supports any class of Linux application such as desktop applications, server tools, IoT apps and even system services such as the printer driver stack. To ensure this, Snap relies on systemd for features such as running socket-activated system services in a Snap. This causes Snap to work best only on distributions that can adopt that init system.


Configurable sandbox

Applications in a Snap run in a container with limited access to the host system. Using ''Interfaces'', users can give an application mediated access to additional features of the host such as recording audio, accessing USB devices and recording video. These interfaces mediate regular Linux APIs so that applications can function in the sandbox without needing to be rewritten. Desktop applications can also use the XDG Desktop Portals, a standardized API originally created by the Flatpak project to give sandboxed desktop applications access to host resources. These portals often provide a better user experience compared to the native Linux APIs because they prompt the user for permission to use resources such as a webcam at the time the application uses them. The downside is that applications and toolkits need to be rewritten in order to use these newer APIs. The Snap sandbox also supports sharing data and Unix sockets between Snaps. This is often used to share common libraries and application frameworks between Snaps to reduce the size of Snaps by avoiding duplication. The Snap sandbox heavily relies on the
AppArmor AppArmor ("Application Armor") is a Linux kernel security module that allows the system administrator to restrict programs' capabilities with per-program profiles. Profiles can allow capabilities like network access, raw socket access, and the ...
Linux Security Module from the upstream Linux kernel. Because only one "major" Linux Security Module (LSM) can be active at the same time, the Snap sandbox is much less secure when another major LSM is enabled. As a result, on distributions such as
Fedora A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
which enable SELinux by default, the Snap sandbox is heavily degraded. Although Canonical is working with many other developers and companies to make it possible for multiple LSMs to run at the same time, this solution is still a long time away. The Snap sandbox prevents snapped desktop applications from accessing the themes of the host operating system to prevent compatibility issues. In order for Snaps to use a theme, it also needs to be packaged in a separate Snap. Many popular themes are packaged by the Snap developers but some themes are not supported yet and uncommon themes have to be installed manually. If a theme is not available as a Snap package, users have to resort to choosing the best matching theme available. Work is ongoing to make it easier for third parties to package themes in a Snap and to automatically install uncommon system themes.


Automatic and atomic updates

Multiple times a day, snapd checks for available updates of all Snaps and installs them in the background using an
atomic operation In concurrent programming, an operation (or set of operations) is linearizable if it consists of an ordered list of invocation and response events ( event), that may be extended by adding response events such that: # The extended list can be re- ...
. Updates can be reverted and use
delta encoding Delta encoding is a way of storing or transmitting data in the form of '' differences'' (deltas) between sequential data rather than complete files; more generally this is known as data differencing. Delta encoding is sometimes called delta compr ...
to reduce their download size. Publishers can release and update multiple versions of their software in parallel using ''channels''. Each channel has a specific ''track'' and ''risk'', which indicate the ''version'' and ''stability'' of the software released on that channel. When installing an application, Snap defaults to using the latest/stable channel, which will automatically update to new major releases of the software when they become available. Publishers can create additional channels to give users the possibility to stick to specific major releases of their software. For example, a 2.0/stable channel would allow users to stick to the 2.0 version of the software and only get minor updates without the risk of backwards incompatible changes. When the publisher releases a new major version in a new channel, users can manually update to the next version when they choose. The schedule, frequency and timing of automatic updates can be configured by users. For example, this command will check for updates on the last Friday from 23:00 to 01:00. $ sudo snap set system refresh.timer=fri5,23:00-01:00 Users can also pause automatic updates for a certain period of time, or indefinitely. Updates are automatically paused on metered connections.


Snapcraft

Snapcraft is a tool for developers to package their programs in the Snap format. It runs on any Linux distribution supported by Snap, macOS and Microsoft Windows. Snapcraft builds the packages in a Virtual Machine using Multipass, in order to ensure the result of a build is the same, regardless of which distribution or operating system it is built on. Snapcraft supports multiple build tools and programming languages, such as Go, Java, JavaScript,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pr ...
, C/
C++ C, or c, is the third letter in the Latin alphabet, used in the modern English alphabet, the alphabets of other western European languages and others worldwide. Its name in English is ''cee'' (pronounced ), plural ''cees''. History "C" ...
and
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH) ...
. It also allows importing application metadata from multiple sources such as
AppStream AppStream is an agreement between major Linux vendors (i.e. Red Hat, Canonical, SUSE, Debian, Mandriva, etc.) to create an infrastructure for application installers on Linux and sharing of metadata. The initiative was started as early as 19-21 Ja ...
,
git Git () is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data inte ...
, shell scripts and setup.py files.


Adoption

Snap initially only supported the all-Snap Ubuntu Core distribution, but in June 2016, it was ported to a wide range of Linux distributions to become a format for universal Linux packages. Snap requires Systemd which is available in most, but not all, Linux distributions. Other Unix-like systems (e.g. FreeBSD) are not supported.
ChromeOS ChromeOS, sometimes stylized as chromeOS and formerly styled as Chrome OS, is a Linux-based operating system designed by Google. It is derived from the open-source ChromiumOS and uses the Google Chrome web browser as its principal user interfac ...
does not support Snap directly, only through Linux distros installed in it that support Snap, such as Gallium OS. A number of Linux distributions support Snap out of the box such as
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All the ...
(and its derivatives, such as
Kubuntu Kubuntu ( ) is an official flavor of the Ubuntu operating system that uses the KDE Plasma Desktop instead of the GNOME desktop environment. As part of the Ubuntu project, Kubuntu uses the same underlying systems. Kubuntu shares the same reposito ...
and Xubuntu),
Manjaro Manjaro ( ) is a free and open-source Linux distribution based on the Arch Linux operating system that has a focus on user-friendliness and accessibility. It uses a rolling release update model and Pacman as its package manager. It is develope ...
, Zorin OS, KDE Neon,
Solus Solus may refer to: *Solus or Soluntum, an ancient city of Sicily * ''Solus'' (comics), an American comic book series *Solus (operating system), an operating system based on the Linux kernel * ''Solus'' (moth), a genus of moths in the family Saturn ...
and Li-f-e. Snap is also available for many other distributions such as
CentOS CentOS (, from Community Enterprise Operating System; also known as CentOS Linux) is a Linux distribution that provides a free and open-source community-supported computing platform, functionally compatible with its upstream source, Red Hat En ...
, Debian,
Elementary OS elementary OS is a Linux distribution based on Ubuntu LTS. It promotes itself as a "thoughtful, capable, and ethical" replacement to macOS and Windows and has a pay-what-you-want model. The operating system, the desktop environment (called Pa ...
,
Fedora A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
, GalliumOS, Kali Linux,
Linux Mint Linux Mint is a community-driven Linux distribution based on Ubuntu (which is in turn based on Debian), bundled with a variety of free and open-source applications. It can provide full out-of-the-box multimedia support for those who choose to ...
, OpenEmbedded,
Parrot Security OS Parrot OS is a Linux distribution based on Debian with a focus on security, privacy, and development. Core Parrot is based on Debian's "testing" branch, with a Linux 5.10 kernel. It follows a rolling release development model. The desktop en ...
, Pop!_OS, Raspbian,
Red Hat Enterprise Linux Red Hat Enterprise Linux (RHEL) is a commercial open-source Linux distribution developed by Red Hat for the commercial market. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop vers ...
and openSUSE. A number of notable Desktop software development companies publish their software in the Snap Store, including Google,
JetBrains JetBrains s.r.o. (formerly IntelliJ Software s.r.o.) is a Czech software development company which makes tools for software developers and project managers. , the company has offices in Prague; Munich; Berlin; Boston, Massachusetts; Amsterdam; ...
,
KDE KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-known products include the ...
, Microsoft (for Linux versions of e.g. .NET Core 3.1,
Visual Studio Code Visual Studio Code, also commonly referred to as VS Code, is a source-code editor made by Microsoft with the Electron Framework, for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code complet ...
, Skype, and
PowerShell PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-sou ...
), Mozilla and Spotify. Snaps are also used in
Internet-of-Things The Internet of things (IoT) describes physical objects (or groups of such objects) with sensors, processing ability, software and other technologies that connect and exchange data with other devices and systems over the Internet or other comm ...
environments, ranging from consumer-facing products to enterprise device management gateways and satellite communication networks. Finally, Snap is also used by developers of server applications such as InfluxDB, Kata Containers,
Nextcloud Nextcloud is a suite of client-server software for creating and using file hosting services. Nextcloud provides functionally similar to Dropbox, Office 365 or Google Drive when used with integrated office suite solutions Collabora Online or Only ...
and
Travis CI Travis CI is a hosted continuous integration service used to build and test software projects hosted on GitHub, Bitbucket, GitLab, Perforce, Apache Subversion and Assembla. Travis CI was the first CI service that provided services to open-sour ...
. In 2019, Canonical decided to switch the Chromium web browser in future Ubuntu releases from an APT package to a Snap. They explained that Snap made it much easier to support Chromium on all supported Ubuntu releases. This allowed them to focus engineering resources on other parts of the Ubuntu desktop. As a result of this decision, Ubuntu derivatives such as Linux Mint had to choose between maintaining their own version of the Chromium package or switching to the snapped version of Chromium maintained by Canonical.


Reception

Snap has received mixed reaction from the developer community. On Snap's promotional site,
Heroku Heroku is a cloud platform as a service (PaaS) supporting several programming languages. One of the first cloud platforms, Heroku has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, ...
praised Snap's auto-update as it fits their fast release schedule well. Microsoft mentions its ease of use and Snap being
YAML YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
-based, as well as it being distribution-agnostic.
JetBrains JetBrains s.r.o. (formerly IntelliJ Software s.r.o.) is a Czech software development company which makes tools for software developers and project managers. , the company has offices in Prague; Munich; Berlin; Boston, Massachusetts; Amsterdam; ...
says the Snap Store gives their tools more exposure. Others have objected to the closed-source nature of the Snap Store. Clement Lefebvre (
Linux Mint Linux Mint is a community-driven Linux distribution based on Ubuntu (which is in turn based on Debian), bundled with a variety of free and open-source applications. It can provide full out-of-the-box multimedia support for those who choose to ...
founder and project leader) 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. He later announced that the installing of Snap would be blocked by APT in Linux Mint, although a way to disable this restriction would be documented.


See also

*
AppImage AppImage is a format for distributing portable software on Linux without needing superuser permissions to install the application. It tries also to allow Linux distribution-agnostic binary software deployment for application developers, also ...
* Flatpak *
Nix Nix or NIX may refer to: Places * Nix, Alabama, an unincorporated community, United States * Nix, Texas, a ghost town in southwestern Lampasas County, Texas, United States * Nix (moon), a moon of Pluto People * Nix (surname), listing people wit ...
*
Portable application creators Portable application creators allow the creation of portable applications (also called portable apps). They usually use application virtualization. Creators of independent portable No agent or client is required for these (also called " agentless ...
* ROX uses directories ( AppDirs) as application bundles. *
Zero Install Zero Install is a means of distributing and packaging software for multiple operating systems (Unix-like including Linux and macOS, Windows). Software Rather than the normal method of downloading a software package, extracting it, and install ...
, a similar project * List of Linux package management systems


References


External links


Official website

A technical comparison between snaps and debs
{{Linux package management systems Free software Linux installation software Linux package management-related software Operating system technology Package management systems Software distribution Ubuntu