Difference between revisions of "Ubuntu Snap/en"

From FreeCAD Documentation
Jump to navigation Jump to search
(Updating to match new version of source page)
(Updating to match new version of source page)
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<languages/>
 
<languages/>
 
{{TOCright}}
 
{{TOCright}}
 +
 
== Introduction ==
 
== Introduction ==
  
An [[Ubuntu_Snap|Ubuntu Snap]] package, or just [[Ubuntu_Snap|Snap]] is a distribution format similar to [[AppImage|AppImage]] in that it is intended to be a "universal installable package" to deploy software in Linux systems. Snaps were introduced by Ubuntu but they are intended to run in all Linux distributions as long as the Snap daemon, or {{incode|snapd}}, is available in the target system.
+
An [[Ubuntu_Snap|Ubuntu Snap]] package, or just [[Ubuntu_Snap|Snap]] is a distribution format similar to [[AppImage|AppImage]] in that it is intended to be a "universal installable package" to deploy software on Linux systems. Snaps were introduced by Ubuntu but they are intended to run on all Linux distributions as long as the Snap daemon, or {{incode|snapd}}, is available on the target system.
  
 
A Snap package has two main characteristics:
 
A Snap package has two main characteristics:
* Programs are sandboxed so they do not interfere with the rest of your operating system.
+
* Programs are sandboxed so they do not interfere with the rest of the operating system.
 
* Programs are updated automatically in the background in order to get the newest version of the application.
 
* Programs are updated automatically in the background in order to get the newest version of the application.
  
Line 13: Line 14:
 
== Installation ==
 
== Installation ==
  
As of v0.19 the use of Snaps is experimental. The current Snaps are generated and hosted by volunteers.
+
The use of Snaps is experimental. The current Snaps are generated and hosted by volunteers.
  
In all systems where Snaps are to be installed, the Snap daemon must be installed first. The package is normally called {{incode|snapd}}.
+
On all systems where Snaps are to be installed, the Snap daemon must be installed first. The package is normally called {{incode|snapd}}.
  
 
=== Debian/Ubuntu ===
 
=== Debian/Ubuntu ===
  
 
For Debian/Ubuntu and similar systems which use the APT manager the daemon is installed as follows:
 
For Debian/Ubuntu and similar systems which use the APT manager the daemon is installed as follows:
 +
 
{{Code|lang=bash|code=
 
{{Code|lang=bash|code=
 
sudo apt install snapd
 
sudo apt install snapd
Line 25: Line 27:
  
 
To install the stable version of the Snap use:
 
To install the stable version of the Snap use:
 +
 
{{Code|lang=bash|code=
 
{{Code|lang=bash|code=
 
sudo snap install freecad
 
sudo snap install freecad
Line 30: Line 33:
  
 
To install the development version of the Snap use:
 
To install the development version of the Snap use:
 +
 
{{Code|lang=bash|code=
 
{{Code|lang=bash|code=
 
sudo snap install --edge freecad-ppd
 
sudo snap install --edge freecad-ppd
Line 37: Line 41:
  
 
To install the stable version of the Snap use:
 
To install the stable version of the Snap use:
 +
 
{{Code|lang=bash|code=
 
{{Code|lang=bash|code=
 
snap install freecad
 
snap install freecad
 
}}  
 
}}  
 +
 
To install the development version of the Snap use:
 
To install the development version of the Snap use:
 +
 
{{Code|lang=bash|code=
 
{{Code|lang=bash|code=
 
snap install --edge freecad-ppd
 
snap install --edge freecad-ppd
Line 47: Line 54:
 
== Notes ==
 
== Notes ==
  
* Figuring out what development version is installed type the following in the CLI
+
To figure out which development version is installed type the following in the Command-line interface:
: {{Code|lang=bash|code=
+
 
 +
{{Code|lang=bash|code=
 
snap info freecad-ppd
 
snap info freecad-ppd
 
}}
 
}}
Line 54: Line 62:
 
== Advanced ==
 
== Advanced ==
  
The following commands are geared for users that are familiar with git and have a locally cloned repository of upstream FreeCAD repo
+
The following commands are geared towards users that are familiar with git and have a locally cloned repository of the upstream FreeCAD repository.
: {{Code|lang=bash|code=
+
 
 +
{{Code|lang=bash|code=
 
git clone https://github.com/FreeCAD/FreeCAD
 
git clone https://github.com/FreeCAD/FreeCAD
 
cd FreeCAD/
 
cd FreeCAD/
 
}}
 
}}
  
* Find out the latest upstream revision number (also known as 'HEAD').
+
To find out the latest upstream revision number (also known as 'HEAD'):
: {{Code|lang=bash|code=
+
 
git rev-list --count HEAD
+
{{Code|lang=bash|code=
 +
git pull upstream master  # first make sure we have the most up-to-date commits
 +
git rev-list --count HEAD # 'HEAD' refers to the current commit you are viewing (tip of the master branch)
 
}}
 
}}
  
* Translate the current snap development version in to a revision number. Make sure you're within your FreeCAD cloned repo (as mentioned above)
+
To translate the current snap development version in to a revision number (make sure you're within your cloned FreeCAD repository as mentioned above):
: {{Code|lang=bash|code=
+
 
snap info freecad-ppd {{!}} grep -e '^installed:' {{!}} awk -F ' ' '{ print $2 }' {{!}} cut -d'~' -f2 {{!}} xargs -I{} git rev-list --count {}
+
{{Code|lang=bash|code=
 +
snap info freecad-ppd <nowiki>|</nowiki>\
 +
grep -e '^\s\+latest/edge' <nowiki>|</nowiki>\
 +
awk -F ' ' '{ print $2 }' <nowiki>|</nowiki>\
 +
xargs -I{} git rev-list --count {}
 
}}
 
}}
  
* The difference between the numbers will tell you have many revisions behind upstream the snap development (edge) is
+
'''Note:''' the above bash script 1 liner assumes user has 'edge' (nightly) installed
 +
 
 +
The difference between HEAD and the snap edge revision numbers indicates the amount of revisions trailing behind upstream the snap development (edge) is.
 +
 
 +
Taking it a step further, if you want a short summary of the commits between the current snap edge and HEAD:
 +
 
 +
{{Code|lang=bash|code=
 +
snap info freecad-ppd <nowiki>|</nowiki>\
 +
grep -e '^\s\+latest/edge' <nowiki>|</nowiki>\
 +
awk -F ' ' '{ print $2 }' <nowiki>|</nowiki>\
 +
xargs -I{} git log --oneline --ancestry-path {}..HEAD
 +
}}
 +
 
 +
'''Note:''' The output will indicate what commits '''are not''' in the current 'edge' (but will be on the next nightly update).
  
 
== Links ==
 
== Links ==
  
More information about current efforts to deal with Snaps.
+
More information about the current efforts to deal with Snaps:
* [https://forum.freecadweb.org/viewtopic.php?f=4&t=46044 0.19 Snap Preview needs "testers"], older Snap by {{Emphasis|vejmarie}}
+
* [https://forum.freecadweb.org/viewtopic.php?f=4&t=46044 0.19 Snap Preview needs "testers"], older Snap by {{Emphasis|vejmarie}}.
* [https://forum.freecadweb.org/viewtopic.php?f=42&t=46853 Discussion: State of the snap (Snap Packaging)], newer version of the Snap by {{Emphasis|ppd}}
+
* [https://forum.freecadweb.org/viewtopic.php?f=42&t=46853 Discussion: State of the snap (Snap Packaging)], newer version of the Snap by {{Emphasis|ppd}}.
 +
 
 +
* [[AppImage|AppImage]] - another self-contained 'binary' like format to run FreeCAD
 +
* [[Flatpak|Flatpak]]
  
* [[AppImage]] - another self-contained 'binary' like format to run FreeCAD
 
* [[Flatpak]]
 
  
 
{{Userdocnavi{{#translation:}}}}
 
{{Userdocnavi{{#translation:}}}}

Revision as of 13:00, 2 April 2022

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎русский

Introduction

An Ubuntu Snap package, or just Snap is a distribution format similar to AppImage in that it is intended to be a "universal installable package" to deploy software on Linux systems. Snaps were introduced by Ubuntu but they are intended to run on all Linux distributions as long as the Snap daemon, or snapd, is available on the target system.

A Snap package has two main characteristics:

  • Programs are sandboxed so they do not interfere with the rest of the operating system.
  • Programs are updated automatically in the background in order to get the newest version of the application.

For other ways of installing the software, see Installing on Linux.

Installation

The use of Snaps is experimental. The current Snaps are generated and hosted by volunteers.

On all systems where Snaps are to be installed, the Snap daemon must be installed first. The package is normally called snapd.

Debian/Ubuntu

For Debian/Ubuntu and similar systems which use the APT manager the daemon is installed as follows:

sudo apt install snapd

To install the stable version of the Snap use:

sudo snap install freecad

To install the development version of the Snap use:

sudo snap install --edge freecad-ppd

Manjaro

To install the stable version of the Snap use:

snap install freecad

To install the development version of the Snap use:

snap install --edge freecad-ppd

Notes

To figure out which development version is installed type the following in the Command-line interface:

snap info freecad-ppd

Advanced

The following commands are geared towards users that are familiar with git and have a locally cloned repository of the upstream FreeCAD repository.

git clone https://github.com/FreeCAD/FreeCAD
cd FreeCAD/

To find out the latest upstream revision number (also known as 'HEAD'):

git pull upstream master  # first make sure we have the most up-to-date commits
git rev-list --count HEAD # 'HEAD' refers to the current commit you are viewing (tip of the master branch)

To translate the current snap development version in to a revision number (make sure you're within your cloned FreeCAD repository as mentioned above):

snap info freecad-ppd |\
grep -e '^\s\+latest/edge' |\
awk -F ' ' '{ print $2 }' |\
xargs -I{} git rev-list --count {}

Note: the above bash script 1 liner assumes user has 'edge' (nightly) installed

The difference between HEAD and the snap edge revision numbers indicates the amount of revisions trailing behind upstream the snap development (edge) is.

Taking it a step further, if you want a short summary of the commits between the current snap edge and HEAD:

snap info freecad-ppd |\
grep -e '^\s\+latest/edge' |\
awk -F ' ' '{ print $2 }' |\
xargs -I{} git log --oneline --ancestry-path {}..HEAD

Note: The output will indicate what commits are not in the current 'edge' (but will be on the next nightly update).

Links

More information about the current efforts to deal with Snaps:

  • AppImage - another self-contained 'binary' like format to run FreeCAD
  • Flatpak