Snappy: Difference between revisions

From 太極
Jump to navigation Jump to search
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= [https://en.wikipedia.org/wiki/Snappy_(package_manager) Snappy (package manager)] =
= Why choose Flatpaks and Snaps =
[https://www.makeuseof.com/why-flatpaks-snaps-better-than-other-formats/ 6 Reasons Flatpaks and Snaps Are Great for Linux]
* You Get New Apps and Updates Right Away
* Developers Can Easily Get Their Apps on Linux
* Developers Ship to All Distros From One Place
* Increased Security Through Sandboxing
* Keep Your Apps When Upgrading Your Distro
* Use the Latest Apps on an Old or LTS Distro


= Snappy (package manager) =
* https://wiki.ubuntu.com/Snappy
* https://en.wikipedia.org/wiki/Snappy_(package_manager)
* [https://developer.ubuntu.com/en/snappy/ Ubuntu Snappy Core]  
* [https://developer.ubuntu.com/en/snappy/ Ubuntu Snappy Core]  
* [https://snapcraft.io/ Snapcraft] - Snapcraft is the command line tool for writing and publishing your software as a snap.
* [https://snapcraft.io/ Snapcraft] - Snapcraft is the command line tool for writing and publishing your software as a snap.
* [https://www.fossmint.com/install-popular-windows-apps-on-linux/ 10 Popular Windows Apps That Are Also Available on Linux]
* [https://www.fossmint.com/install-popular-windows-apps-on-linux/ 10 Popular Windows Apps That Are Also Available on Linux]
* [https://www.howtogeek.com/670084/what-you-need-to-know-about-snaps-on-ubuntu-20.04/ What You Need to Know About Snaps on Ubuntu 20.04]
* [https://www.howtogeek.com/670084/what-you-need-to-know-about-snaps-on-ubuntu-20.04/ What You Need to Know About Snaps on Ubuntu 20.04]
== Does the Snap Store Use Too Much Memory, data ==
On my Ubuntu 20.04, snap-store uses about 300MB memory (number 1 according to the system monitor).
* [https://www.omgubuntu.co.uk/2020/10/gnome-software-uses-lots-of-memory Does the Snap Store Use Too Much Memory?]
* [https://askubuntu.com/a/1131682 Why does the snapd service use so much data?]
* [https://askubuntu.com/a/1243788 If I remove snap-store, what impact will this have on already installed snaps?] You will be able to continue using your existing snaps. You can use the command-line to install more snaps, remove existing ones, and, generally, do most everything. One convenience the snap store installed on your system offers is that of modifying the permissions you wish a snap to use
* [https://askubuntu.com/a/1262997 Should the snap-store be using >300Mb of memory?]
<pre>
sudo snap remove snap-store && sudo apt install gnome-software
</pre>
I find I still need to manually kill the existing process.
== Some in my list ==
Default in Ubuntu 20.04
{{Pre}}
$ snap list
Name              Version            Rev    Tracking        Publisher  Notes
core18            20201210            1944  latest/stable    canonical✓  base
gnome-3-34-1804    0+git.3556cb3      60    latest/stable/…  canonical✓  -
gtk-common-themes  0.1-50-gf7627e4    1514  latest/stable/…  canonical✓  -
snap-store        3.38.0-59-g494f078  518    latest/stable/…  canonical✓  -
snapd              2.48.1              10492  latest/stable    canonical✓  snapd
</pre>
Others:
* glances
* krop


= How Snappy packages are different from Deb =
= How Snappy packages are different from Deb =
Line 13: Line 52:
* An update can never fail, as a package installation could potentially fail and become incomplete with typical Linux packages.
* An update can never fail, as a package installation could potentially fail and become incomplete with typical Linux packages.
* Snappy also supports “delta” updates, which means only the changed bits of the package need to be downloaded and installed.
* Snappy also supports “delta” updates, which means only the changed bits of the package need to be downloaded and installed.
* Snappy-based Ubuntu systems might be standard.  
* Snappy-based Ubuntu systems might be standard.
 
== Snap vs Flatpak vs AppImage ==
[https://www.fosslinux.com/42410/snap-vs-flatpak-vs-appimage-know-the-differences-which-is-better.htm Snap vs. Flatpak vs. AppImage: Know The Differences, Which is Better]
 
[https://askubuntu.com/a/1009061 What are the differences between snaps, appimage, flatpak and others?]
 
[https://www.atechtown.com/flatpak-vs-snap/ Flatpak vs Snap: Which one should I use?]
 
* The first big difference is that '''Snap''' is a project of Canonical that in the future intends that all Ubuntu programs will use this technology. While '''Flatpak''' is not associated with any Linux distribution and its goal is to improve the installation of the programs in Linux.
* Snap supports IoT or network services technologies while Flatpak focuses on desktop applications
* Flatpak applications can also be launched/searched from the Ubuntu desktop ('''need to log out and log in again''')


= [https://docs.snapcraft.io/reference/snap-command Snap commands] =
= [https://docs.snapcraft.io/reference/snap-command Snap commands] =
Line 40: Line 90:
</pre>
</pre>


= How To Remove Old Snap Versions To Free Up Disk Space =
== How To Remove Old Snap Versions To Free Up Disk Space ==
https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html
* [https://itsfoss.com/clean-snap-packages/ How to Clean Up Snap Package Versions in Linux] 2022
* https://www.linuxuprising.com/2019/04/how-to-remove-old-snap-versions-to-free.html


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 68: Line 119:
1.1G /var/lib/snapd/snaps/
1.1G /var/lib/snapd/snaps/
</syntaxhighlight>
</syntaxhighlight>
= Flatpak =
* https://flatpak.org/
** Sublime, GIMP, Spotify, Visual Studio Code, Marker, Gradio, VLC, Android Studio, Audacity, Atom, FileZilla, draw.io desktop, [https://flathub.org/apps/details/com.github.geigi.cozy Cozy] and others.
** [https://flatpak.org/setup/ Flatpak setup],
** [http://docs.flatpak.org/en/latest/using-flatpak.html Using flatpak]
* Pros and cons
** Apps can be launched by search their names in GNOME
** Flatpak does not automatically update the packages on the system. Doing a system update on a Debian-derived system does not update the Flatpak packages. We need to run '''flatpak update''' manually.
** '''Problem''': For instance, take Sublime Text as an example. On Flathub, the available version is 3.2.2, build 3211, which dates back to 2019. In contrast, the current version is 4, build 4169, released in 2024.
** We can install multiple versions of an application.
* [https://itsfoss.com/flatpak-guide/ Using Flatpak on Ubuntu and Other Linux Distributions (Complete Guide)]
<pre>
# Run/launch an app
flatpak run org.keepassxc.KeePassXC
# List apps
flatpak list --app
# List run-time libraries
flatpak list --runtime
# Install a flatpak package
flatpak install flathub de.haeckerfelix.Shortwave
# Uninstall a flatpak package
flatpak uninstall --delete-data de.haeckerfelix.Shortwave
# Removing flatpak apps WILL NOT remove the independent runtime libraries
#    (QT, GNOME platforms)
# Run this command to get rid of them to free up disk space:
flatpak uninstall --unused
</pre>
Consider the [https://obsproject.com/download OBS] app. The installation process is saved in [https://gist.github.com/arraytools/bd0800195adec3d3ac48c7e79734c498 here]. To launch the app,
<pre>
$ flatpak list --app
Name              Application ID              Version      Branch      Installation
OBS Studio        com.obsproject.Studio      29.1.3        stable      system
$ flatpak run com.obsproject.Studio
</pre>
Flatpak apps are installed in two locations: system-wide ('''/var/lib/flatpak/''') and per-user ($HOME/.local/share/flatpak/).
Consider the [https://flathub.org/apps/details/de.haeckerfelix.gradio Gradio] app.
{{Pre}}
$ flatpak install de.haeckerfelix.gradio.flatpakref # it will ask the password in a new window
$ flatpak uninstall de.haeckerfelix.gradio
</pre>
Now we can launch the Gradio app from the Launch Menu.
Note: no 'sudo' is required.
== Warehouse: GUI to manage Flatpak apps ==
[https://ostechnix.com/manage-flatpak-applications-with-warehouse-in-linux/ How To Manage Flatpak Applications Effortlessly With Warehouse In Linux]
== Update fails ==
[https://ostechnix.com/flatpak-update-fails-after-upgrading-curl-to-8-10-in-debian/ Flatpak Update Fails After Upgrading Curl To 8.10 In Debian 12 | How To Fix It]
== Remove unused flatpak runtimes ==
[https://www.linuxuprising.com/2019/02/how-to-remove-unused-flatpak-runtimes.html How To Remove Unused Flatpak Runtimes To Free Up Disk Space]
== How to update a flatpak app ==
[https://www.linux.com/training-tutorials/how-install-and-use-flatpak-linux  How to Install and Use Flatpak on Linux]
<pre>
flatpak list
sudo flatpak update org.gimp.GIMP
</pre>
== Where are the files ==
https://github.com/flatpak/flatpak/wiki/Filesystem
* .local/share/flatpak
* /var/lib/flatpak/app
= AppImage =
<ul>
<li>http://appimage.org/ AppImage
<li>We need to make the file executable before we can open it. Right click the file, Properties -> Permissions.
<li>Advantages
* portability. ''AppImages are usually faster than snaps or flatpaks and need less storage space. They are also easy to remove as you can delete AppImage files anytime you want without interrupting other system processes.''
* AppImages can be downloaded and '''run without installation or the need for root rights'''.
<li>[http://askubuntu.com/questions/774490/what-is-an-appimage-how-do-i-install-it What is an “AppImage”? How do I install it?]
<li>The key idea of the AppImage format is one app = one file. Every AppImage contains an app and all the files the app needs to run. In other words, each AppImage has no dependencies other than what is included in the targeted base operating system(s).
<li>[https://linuxconfig.org/how-to-create-an-integrated-application-launcher-for-an-appimage-file-in-ubuntu How to Create an Integrated Application Launcher For an Appimage file in Ubuntu]
<li>[https://itsfoss.com/cant-run-appimage-ubuntu/ Can’t Run AppImage on Ubuntu 22.04? Here’s How to Fix it]
<li>[https://ostechnix.com/manage-appimages-with-gear-lever/ How To Easily Manage AppImages With "Gear Lever" In Linux]
<li>[https://appimage.github.io/ Applications].Some examples
* [http://avidemux.sourceforge.net/download.html Avidemux]
* Bitwarden
* Cura
* [https://github.com/pavlobu/deskreen Deskreen]
* Draw.io
* Etcher
* [https://www.falkon.org/download/ falkon] browser
* [https://inkscape.org/ Inkscape]
* Krita
</li>
</ul>
== Problems ==
* Take the [https://www.es-de.org/ ES-DE] as an example. I got a lot of errors when I try to run the executable. Read '''Things to remember while using AppImage in Linux''' from [https://itsfoss.com/use-appimage-linux/ Using AppImage in Linux (Complete Guide)].
:<syntaxhighlight lang='sh'>
$ ./ES-DE_x64.AppImage
./ES-DE_x64.AppImage: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by ./ES-DE_x64.AppImage)
./ES-DE_x64.AppImage: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./ES-DE_x64.AppImage)
</syntaxhighlight>
* files is they cannot be found in Ubuntu's launcher/search function.''' But check out this: [https://ostechnix.com/integrate-appimages-to-application-menu-using-appimagelauncher/ Integrate AppImages To Application Menu Using AppImageLauncher]. Note: this is for Ubuntu only. Debian does not work'''.
* [https://bytexd.com/how-to-install-and-configure-appimage-on-ubuntu/ Pros and Cons] No proper update system for AppImage currently. Terminal command completion solution doesn’t work
== appimaged ==
It seems to be easier to create a '''~/bin''' directory and move all downloaded AppImage files there.
* https://docs.appimage.org/introduction/software-overview.html#appimaged
** One of the monitored directories is ~/Downloads. If the directory is very large, appimaged usually needs quite long to visit all files. It is likely to slow down the system (specifically, the filesystem).
* https://github.com/probonopd/go-appimage
== Shortcut ==
[https://www.ubuntumint.com/create-appimage-shortcut-in-ubuntu/ How to Create AppImage Shortcut in Ubuntu]
== AppImageLauncher ==
It has not been developed after 2000.


= Docker =
= Docker =

Latest revision as of 19:43, 23 October 2024

Why choose Flatpaks and Snaps

6 Reasons Flatpaks and Snaps Are Great for Linux

  • You Get New Apps and Updates Right Away
  • Developers Can Easily Get Their Apps on Linux
  • Developers Ship to All Distros From One Place
  • Increased Security Through Sandboxing
  • Keep Your Apps When Upgrading Your Distro
  • Use the Latest Apps on an Old or LTS Distro

Snappy (package manager)

Does the Snap Store Use Too Much Memory, data

On my Ubuntu 20.04, snap-store uses about 300MB memory (number 1 according to the system monitor).

sudo snap remove snap-store && sudo apt install gnome-software

I find I still need to manually kill the existing process.

Some in my list

Default in Ubuntu 20.04

$ snap list
Name               Version             Rev    Tracking         Publisher   Notes
core18             20201210            1944   latest/stable    canonical✓  base
gnome-3-34-1804    0+git.3556cb3       60     latest/stable/…  canonical✓  -
gtk-common-themes  0.1-50-gf7627e4     1514   latest/stable/…  canonical✓  -
snap-store         3.38.0-59-g494f078  518    latest/stable/…  canonical✓  -
snapd              2.48.1              10492  latest/stable    canonical✓  snapd

Others:

  • glances
  • krop

How Snappy packages are different from Deb

An article from PCWorld. Skype, Spotify, Minecraft, JetBrains Dev Suite, MySQL Workbench, Blender.

  • Applications are no longer installed system-wide. The base Ubuntu operating system is kept securely isolated from applications you install later. Both the base system and Snappy packages are kept as read-only images.
  • Snappy packages can include all the libraries and files they need, so they don’t depend on other packages.
  • An update can never fail, as a package installation could potentially fail and become incomplete with typical Linux packages.
  • Snappy also supports “delta” updates, which means only the changed bits of the package need to be downloaded and installed.
  • Snappy-based Ubuntu systems might be standard.

Snap vs Flatpak vs AppImage

Snap vs. Flatpak vs. AppImage: Know The Differences, Which is Better

What are the differences between snaps, appimage, flatpak and others?

Flatpak vs Snap: Which one should I use?

  • The first big difference is that Snap is a project of Canonical that in the future intends that all Ubuntu programs will use this technology. While Flatpak is not associated with any Linux distribution and its goal is to improve the installation of the programs in Linux.
  • Snap supports IoT or network services technologies while Flatpak focuses on desktop applications
  • Flatpak applications can also be launched/searched from the Ubuntu desktop (need to log out and log in again)

Snap commands

Some snap commands

  1. snap help
  2. snap version
  3. snap list: see a list of installed snap app
  4. snap find queryname: find a snap app. For example snap find browser, snap find media.
  5. snap install appname: install snap apps
  6. snap remove appname: remove snap apps
  7. snap info appname: see more information about a snap app
  8. sudo snap refresh: update a snap app. You actually don't need it since snapd runs in the background and handles updates automatically
  9. snap changes: see a history of the changes made to your system

How to run the Snap applications: you can run snap applications just like any other application installed on your system.

6 Essential Ubuntu Snap Commands You Should Know

Update packages

# Update a package
sudo snap refresh <package>

# Update all packages
sudo snap refresh

How To Remove Old Snap Versions To Free Up Disk Space

$ du -sh /var/lib/snapd/snaps/
2.2G	/var/lib/snapd/snaps/
$ ls /var/lib/snapd/snaps/
anbox_167.snap             gnome-characters_206.snap
atom_222.snap              gnome-characters_254.snap
...
gnome-calculator_406.snap  sublime-text_58.snap
gnome-characters_139.snap
$ sudo snap set system refresh.retain=2   # Not useful
[sudo] password for brb: 
$ du -sh /var/lib/snapd/snaps/
2.2G	/var/lib/snapd/snaps/

$ nano remove-old-snaps
$ chmod +x remove-old-snaps
$ sudo ./remove-old-snaps
atom (revision 222) removed
atom (revision 223) removed
...
sublime-text (revision 51) removed
sublime-text (revision 44) removed
$ du -sh /var/lib/snapd/snaps/
1.1G	/var/lib/snapd/snaps/

Flatpak

  • https://flatpak.org/
    • Sublime, GIMP, Spotify, Visual Studio Code, Marker, Gradio, VLC, Android Studio, Audacity, Atom, FileZilla, draw.io desktop, Cozy and others.
    • Flatpak setup,
    • Using flatpak
  • Pros and cons
    • Apps can be launched by search their names in GNOME
    • Flatpak does not automatically update the packages on the system. Doing a system update on a Debian-derived system does not update the Flatpak packages. We need to run flatpak update manually.
    • Problem: For instance, take Sublime Text as an example. On Flathub, the available version is 3.2.2, build 3211, which dates back to 2019. In contrast, the current version is 4, build 4169, released in 2024.
    • We can install multiple versions of an application.
  • Using Flatpak on Ubuntu and Other Linux Distributions (Complete Guide)
# Run/launch an app
flatpak run org.keepassxc.KeePassXC

# List apps
flatpak list --app

# List run-time libraries
flatpak list --runtime

# Install a flatpak package
flatpak install flathub de.haeckerfelix.Shortwave

# Uninstall a flatpak package
flatpak uninstall --delete-data de.haeckerfelix.Shortwave

# Removing flatpak apps WILL NOT remove the independent runtime libraries 
#    (QT, GNOME platforms)
# Run this command to get rid of them to free up disk space:
flatpak uninstall --unused

Consider the OBS app. The installation process is saved in here. To launch the app,

$ flatpak list --app
Name              Application ID              Version       Branch       Installation
OBS Studio        com.obsproject.Studio       29.1.3        stable       system

$ flatpak run com.obsproject.Studio

Flatpak apps are installed in two locations: system-wide (/var/lib/flatpak/) and per-user ($HOME/.local/share/flatpak/).

Consider the Gradio app.

$ flatpak install de.haeckerfelix.gradio.flatpakref # it will ask the password in a new window
$ flatpak uninstall de.haeckerfelix.gradio

Now we can launch the Gradio app from the Launch Menu.

Note: no 'sudo' is required.

Warehouse: GUI to manage Flatpak apps

How To Manage Flatpak Applications Effortlessly With Warehouse In Linux

Update fails

Flatpak Update Fails After Upgrading Curl To 8.10 In Debian 12 | How To Fix It

Remove unused flatpak runtimes

How To Remove Unused Flatpak Runtimes To Free Up Disk Space

How to update a flatpak app

How to Install and Use Flatpak on Linux

flatpak list

sudo flatpak update org.gimp.GIMP

Where are the files

https://github.com/flatpak/flatpak/wiki/Filesystem

  • .local/share/flatpak
  • /var/lib/flatpak/app

AppImage

Problems

$ ./ES-DE_x64.AppImage 
./ES-DE_x64.AppImage: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by ./ES-DE_x64.AppImage)
./ES-DE_x64.AppImage: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./ES-DE_x64.AppImage)

appimaged

It seems to be easier to create a ~/bin directory and move all downloaded AppImage files there.

Shortcut

How to Create AppImage Shortcut in Ubuntu

AppImageLauncher

It has not been developed after 2000.

Docker

I haven't found any tutorial yet!

Ova image

Sorry, I don't get the command line back. Booting stuck in the middle.

Beaglebone

http://beagleboard.org/snappy or http://www.ubuntu.com/things#try-beaglebone

Raspberry Pi 2

https://darrenjw2.wordpress.com/2015/02/07/getting-started-with-snappy-ubuntu-core-on-the-raspberry-pi-2/