Snap Ubuntu: A Deep Dive for IT Professionals

Snap Ubuntu is a software package manager that bundles applications into a single unit. It’s a great way for new and novice users to get started with complicated application installations in Ubuntu. Snap makes it easy to install, update, and remove the application and ensures that all the relevant prerequisites are already met before installing the application.

Snap runs the application in a virtual sandbox environment, abstracted away from the Ubuntu operating system. This means that the application is run in isolation. This is good because it protects the rest of your system and improves security. When you come to uninstall the application, it won’t break any of your locally installed applications.

Useful Snap Ubuntu Commands

The first thing to know is that you can browse the snapcraft website to learn which applications are available as snaps. There are so many awesome applications.

Snap Ubuntu

Finding Snaps to Install

Snap Find

You can search the snap ubuntu store using the find command. It allows you to search for a specific keyword or your can search sections such as “games” or “productivity)

Bash
snap find <keyword>
snap find --section=<section>

For Example:

Bash
snap find microk8s
Name                                  Version                           Publisher     Notes    Summary
microk8s                              v1.29.2                           canonical✓    classic  Kubernetes for workstations 
microk8s-integrator-windows           0.1                               canonical✓    -        MicroK8s Windows integrator
microk8s-integrator-macos             0.1                               canonical✓    -        MicroK8s MacOS integrator
eks                                   v1.18.9                           canonical✓    classic  Amazon EKS Distro (EKS-D) snap
data-science-stack                    0.1-788eae3a43623f36fb4087f94e57  michalhucko   -        ML environments at ease on your AI
pluto                                 0.1.0                             nuccitheboss  -        A swiss-army knife for managing 
content-microk8s-core-addons-offline  latest                            aggkolaitis   -        MicroK8s Core addons offline
fortd                                 v0.9.10-mk8s-ad50fb2              ffoysal       -        A snap to keep your data at your 
content-demo-microk8s                 latest                            kjackal       -        

You can search for the following snap ubuntu sections:

  • art-and-design
  • books-and-reference
  • development
  • devices-and-iot
  • education
  • entertainment
  • featured
  • finance
  • games
  • health-and-fitness
  • music-and-audio
  • news-and-weather
  • personalisation
  • photo-and-video
  • productivity
  • science
  • security
  • server-and-cloud
  • social
  • utilities

For Example:

Bash
snap find --section=science
Name                     Version                  Publisher                   Notes    Summary
stellarium-daily         v24.1                    t4saha                      -        Desktop Planetarium
stellarium-plars         0.21.0                   pwlars                      -        Planetarium software
kstars                   3.6.6                    kde✓                        -        KStars is a desktop 
sirrujak-sciencefair     1.0.8                    rujak                       -        ScienceFair
ctint-science            1.0.0                    zgcddoo                     -        ctint-science
dataexplore              v0.12.0                  dmnfarrell                  -        data plotting and 
rigs-of-rods             2022.12                  paroj                       -        Rigs of Rods
molden                   6.2                      linuxcoffee                 -        Molden is a package 
iraspa                   2.3.0                    dubbelda                    -        A molecular 
functy                   0.38                     flypig                      -        3D graph drawing with 
yacas                    1.6.1-snap1              gm                          -        Yet Another Computer 
kmplot                   23.08.3                  kde✓                        -        Mathematical Function 
truthtables              1.00                     simplelogic                 -        truthtables snap

Managing Snaps

Snap List

Managing Snaps is really useful, especially if you need to tidy up your system after trying out an application.

Bash
snap list

Snap list gives you a list of all the installed snap ubuntu applications on your system. For Example:

Bash
snap list
Name                       Version                     Rev    Tracking            Publisher         Notes
audacious                  4.3.1                       157    latest/stable       sameersharma2006  -
bare                       1.0                         5      latest/stable       canonical✓        base
core18                     20240416                    2823   latest/stable       canonical✓        base
core20                     20240227                    2264   latest/stable       canonical✓        base
core22                     20240408                    1380   latest/stable       canonical✓        base
firefox                    125.0-1                     4136   latest/stable/…     mozilla✓          -
gedit                      46.1                        684    latest/stable       canonical✓        -
glances                    3.4.0.3                     1708   latest/stable       nicolargo         -
gnome-3-28-1804            3.28.0-19-g98f9e67.98f9e67  198    latest/stable       canonical✓        -
gnome-3-38-2004            0+git.efb213a               143    latest/stable/…     canonical✓        -
gnome-42-2204              0+git.510a601               172    latest/stable       canonical✓        -
gtk-common-themes          0.1-81-g442e511             1535   latest/stable/…     canonical✓        -
juju-db                    4.4.18                      160    4.4/stable          juju-qa           -
microk8s                   v1.26.14                    6576   1.26-strict/stable  canonical✓        
office365webdesktop        0.7.2                       5      latest/beta         rafgui012         -
openjdk                    22.0.1+8                    1764   latest/stable       jgneff            -
remmina                    v1.4.35+git1.e0692befd      6419   latest/stable       remmina✓          -
shotcut                    24.04.28                    1447   latest/stable       meltytech✓        classic
snap-store                 41.3-77-g7dc86c8            1113   latest/stable/…     canonical✓        -
snapd                      2.62                        21465  latest/stable       canonical✓        snapd
snapd-desktop-integration  0.9                         157    latest/stable/…     canonical✓        -
spotify                    1.2.31.1205.g4d59ad7c       75     latest/stable       spotify✓          -
vlc                        3.0.20-1-g2617de71b6        3777   latest/stable       videolan✓         -

Snap info

The snap info command is really useful. It displays information about a specific snap, including its version and publisher.

Bash
snap info

For example

Bash
snap info spotify
name:      spotify
summary:   Music for everyone
publisher: Spotify✓
store-url: https://snapcraft.io/spotify
contact:   https://community.spotify.com/t5/Desktop-Linux/bd-p/desktop_linux
license:   unset
description: |
  Love music? Play your favorite songs and albums free on Linux with
  Spotify.
  
  Stream the tracks you love instantly, browse the charts or fire up
  readymade playlists in every genre and mood. Radio plays you great
  song after great song, based on your music taste. Discover new music
  too, with awesome playlists built just for you.
  
  Stream Spotify free, with occasional ads, or go Premium.
  
  Free:
   Play any song, artist, album or playlist instantly
   Browse hundreds of readymade playlists in every genre and mood
   Stay on top of the Charts
   Stream Radio
   Enjoy podcasts, audiobooks and videos
   Discover more music with personalized playlists
  
  Premium:
   Download tunes and play offline
   Listen ad-free
   Get even better sound quality
   Try it free for 30 days, no strings attached
  
  Like us on Facebook: http://www.facebook.com/spotify
  Follow us on Twitter: http://twitter.com/spotify
  
  Note: Spotify for Linux is a labor of love from our engineers that
  wanted to listen to Spotify on their Linux development machines. They
  work on it in their spare time and it is currently not a platform
  that we actively support. The experience may differ from our other
  Spotify Desktop clients, such as Windows and Mac.
commands:
  - spotify
snap-id:      pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7
tracking:     latest/stable
refresh-date: 2024-02-26
channels:
  latest/stable:    1.2.31.1205.g4d59ad7c 2024-02-23 (75) 186MB -
  latest/candidate: 1.2.31.1205.g4d59ad7c 2024-02-21 (75) 186MB -
  latest/beta:      1.2.31.1205.g4d59ad7c 2024-02-21 (75) 186MB -
  latest/edge:      1.2.31.1205.g4d59ad7c 2024-02-21 (75) 186MB -
installed:          1.2.31.1205.g4d59ad7c            (75) 186MB -

Snap Install

This installs a snap from the Snap store.

Bash
snap install <keyword>

Snap Remove


This removes a snap from your system.

Bash
snap remove

For Example

Bash
snap remove --purge microk8s
2024-04-30T10:36:31+01:00 INFO Waiting for "snap.microk8s.daemon-containerd.service" to stop.
Remove data for snap "microk8s" (6576)                                                                                                                                                                       |
microk8s removed

Snap Refresh


This updates all installed snaps to their latest versions.

Bash
snap refresh

For example:

Bash
snap refresh
firefox 125.0.3-1 from Mozilla✓ refreshed
gnome-42-2204 0+git.510a601 from Canonical✓ refreshed

Advantages for IT Environments

  • Simplified Installation and Maintenance: Snaps encapsulate an application and its dependencies, enabling straightforward installation, updates, and removal. This eliminates the intricacies of resolving dependency conflicts, ensuring a consistent experience across diverse Ubuntu systems.
  • Enhanced Security through Isolation: Snaps execute within a secure, sandboxed environment, segregated from the underlying operating system. This isolation bolsters system security by preventing applications from interfering with each other or compromising the host system.
  • Rollbacks and Version Control: Snap’s transactional updates and the ability to revert to previous versions facilitate seamless rollbacks in case of issues, providing an added layer of stability for critical applications.
  • Cross-Distribution Compatibility: Snaps function consistently across various Linux distributions that support snaps, reducing the overhead of managing application deployments on heterogeneous environments.
Elsewhere On TurboGeek:  Vi, Nano, and Vim: The Battle of the Linux Text Editors

Advanced Snap Commands for IT Experts

  • snap interfaces: List the interfaces a snap connects to, enabling fine-grained control over its interactions with the system and other snaps.
  • snap connections: Inspect the established connections between snaps and system resources, aiding in troubleshooting and security audits.
  • snap set: Configure snap-specific settings to customize application behavior or adapt to specific IT requirements.
  • snap try: Test a snap in a disposable environment before committing to a full installation, minimizing the risk of unexpected disruptions.
  • snap logs: Access detailed logs from snaps, facilitating in-depth troubleshooting and performance analysis.
  • snap info --verbose: Retrieve extensive metadata about a snap, including its architecture, confinement level, and installed extensions.

Snap Channels: Tailoring Deployments

Snaps are released through various channels, providing flexibility in managing updates:

  • stable: Recommended for most production environments, offering thoroughly tested and stable releases.
  • candidate: Contains release candidates, suitable for pre-production testing and validation.
  • beta: Ideal for early adopters and IT professionals who want to evaluate new features and provide feedback.
  • edge: Contains the latest development builds, suitable for testing purposes and contributing to snap development.

Use Cases for IT Professionals

  • DevOps and CI/CD: Snaps streamline application deployment and updates within DevOps pipelines, ensuring consistency and reproducibility across development, testing, and production environments.
  • Containerization Alternatives: Snaps offer a lightweight alternative to full-fledged containerization for specific use cases, simplifying application isolation and distribution.
  • Embedded Systems: Snaps’ self-contained nature and efficient resource usage make them suitable for deploying applications on embedded systems and IoT devices.

Snap Ubuntu empowers IT professionals to manage application lifecycles efficiently, enhance system security, and ensure cross-distribution compatibility. By leveraging its advanced features and understanding the various snap channels, IT experts can tailor deployments to specific needs and maintain a stable and secure application environment.

Thats it for now. You now have the basic commands needed to get to grips with Snap.

Richard.Bailey

Richard Bailey, a seasoned tech enthusiast, combines a passion for innovation with a knack for simplifying complex concepts. With over a decade in the industry, he's pioneered transformative solutions, blending creativity with technical prowess. An avid writer, Richard's articles resonate with readers, offering insightful perspectives that bridge the gap between technology and everyday life. His commitment to excellence and tireless pursuit of knowledge continues to inspire and shape the tech landscape.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »