Ubuntu Snaps are a relatively new way to install and update applications on Ubuntu and other Linux distributions. With Snaps, applications are packaged along with their dependencies to run as self-contained systems. This allows apps to work uniformly across different Linux distributions.
Snaps are intended to make it easier for users to install, update, and remove apps on their systems. But they also introduce some downsides compared to traditional app installation methods on Linux. Some users argue Snaps have too many disadvantages and should be avoided where possible.
So should you use Snaps on your Ubuntu installation? Or avoid them in favor of older methods like APT packages or manual installs? Here is an in-depth look at the pros and cons to help you decide.
What are Snaps in Ubuntu?
Snaps are essentially self-contained software packages that bundle an application together with its dependencies. This differs from older app installation methods on Linux like APT packages.
With APT, applications rely on shared libraries and dependencies already installed on your system. Snaps package everything into a single folder that runs in isolation from the rest of the OS.
Canonical introduced Snaps in 2016 to make it easier to install, update, and manage applications on Ubuntu. With a single Snap command, you can install an app without having to locate any dependencies or compile anything from source code. Updates roll out automatically in the background. And removing an app just takes removing the Snap package.
Snaps run securely in their own sandbox environments isolated from the main OS. This prevents apps from conflicting with each other even if they rely on different versions of dependencies. Overall, Snaps aim to provide an easier and more robust app management system compared to traditional Linux app installs.
Benefits of using Snaps
Here are some of the main benefits provided by Snap packages in Ubuntu:
Easier installation
Snaps allow installing apps with a single command – no need to locate dependencies or compile from source. Snaps include everything the app needs to run packaged together. For example, to install the GIMP image editor as a Snap:
sudo snap install gimp
That downloads the Snap package containing GIMP and all its dependencies and sets it up on your system. Much easier than a manual install process.
Automatic updates
Snaps update themselves automatically in the background without user intervention. So apps installed as Snaps always stay up-to-date with the latest releases from the developers. You don’t have to manually trigger updates or compromises on outdated software.
Isolation from system
Snaps run in their own isolated environments known as “slots”. Even system-level Snaps can’t access other parts of the OS. This prevents app conflicts, allows installing different versions in parallel, and improves security.
Works across Linux distributions
Snaps use the same package format and runtime on any Linux distro. So an app distributed as a Snap will work the same way on Ubuntu, Fedora, Arch, etc. Great for app developers who want to target multiple distros.
Reverting app versions is easy
If an app update introduces bugs, you can easily revert to a previous working version by using the snap revert command. Much less hassle than downgrading app versions with APT.
Granular permissions
Snaps only get access to specific system resources and hardware devices if explicitly defined. This allows precisely controlling what a Snap app can access, improving security.
Disadvantages of using Snaps
However, Snaps also come with some notable downsides:
Larger app sizes
Since Snaps bundle all app dependencies, they take up significantly more drive space than a regular app install through a package manager. For example, a simple app like nano installed through Snap is over 45 MB. The APT package is under 1 MB.
This quickly eats up disk space, especially if you install multiple Snaps. It also consumes more bandwidth to download the larger Snap packages, which can be problematic on metered connections.
Slower launch times
The isolation provided by Snaps means apps can’t directly access existing system libraries. Instead, they have to be accessed by the Snap runtime whenever the app launches. This noticeably increases launch times for Snap apps compared to native apps.
Limited desktop integration
Due to the isolation, Snaps have limited ability to integrate with the desktop environment. Features like desktop notifications and app indicators don’t work by default. There are workarounds but the integration is not seamless.
Dependency issues
While Snaps avoid system-level dependency issues, they can still face app-level ones. If the Snap doesn’t include a library the app needs, it may fail to work properly even if the library is actually installed on your system.
Can’t use apt commands
Snaps exist independently from the APT ecosystem. You can’t use apt commands like apt install, apt update etc. on Snaps. A separate set of Snap-specific commands is required to manage them instead.
Lack of customization
It’s not possible to tweak or customize anything within a Snap package. You get what you get. This can be an issue if you need to modify app configs or languages.
Distro-agnostic issues
While Snaps work across distros, sometimes their isolation causes unexpected bugs on non-Ubuntu systems. Performance issues or crashes are more likely when running Snaps on other distros.
Privacy concerns
Some independent security researchers have pointed to potential privacy issues with how Canonical manages Snap app data. There are concerns it could be used to deanonymize Snap users.
Difficult side-by-side installs
If you want a Snap app alongside the same app installed through a native package, it’s tricky getting this set up properly. The isolation means they won’t share config files or data as expected. You may run into permission issues too.
Network issues
Some network-related apps like OpenVPN struggle to work properly as Snaps due to confinement rules blocking access to network resources. These apps often need workarounds to function via Snap.
When Snaps are useful
Despite the disadvantages, there are still certain cases where Snaps can be useful on Ubuntu:
Proprietary apps
Snaps allow proprietary apps that aren’t available in standard Ubuntu repos (like Slack, Skype, etc.) to be installed easily. Great for users who need access to these type of closed-source apps.
App developers
For app developers, Snaps allow directly publishing apps to Ubuntu/Linux users without maintaining separate packages for each distro. Easier to provide updates and iteratively develop apps.
Server apps
On server environments, Snaps allow effortless deployment and updating of apps. Since disk space and desktop integration don’t matter much on servers, Snaps work well in this context.
Apps requiring latest releases
If you need the very latest cutting-edge release of some apps, Snaps can provide more immediate access compared to standard Ubuntu repos.
Dangerous apps
For apps that could pose system risks like malware tools, Snaps add a level of isolation that makes them safer to install and try out.
Cross-distro compatibility
If you need to run apps consistently across many different Linux distros, Snaps allow more compatibility than just using Ubuntu’s native packages.
Snaps vs Flatpak
Flatpak is an alternative to Snaps that also provides a cross-distro app distribution framework. Here’s how Flatpaks compare to Snaps:
Similarities
- Allows apps to run in isolated sandboxes
- Includes app dependencies in package
- Works across many Linux distributions
- Simplifies installing and updating apps
Differences
Snap | Flatpak |
---|---|
Created by Canonical (Ubuntu devs) | Originally created by Fedora devs |
Centralized Snap Store | Apps can be distributed through any repo |
Tighter app sandboxing | Apps can optionally access system resources |
Uses SquashFS filesystem | Relies on OSTree system |
Supports desktop Linux only | Also available on server distros |
Overall, Flatpak provides looser app sandboxing and decentralization compared to Snaps. But it lacks some desktop integration features present in Snaps. Either can serve as a solid app distribution framework.
Conclusion
To recap – should you use Snaps on your Ubuntu system?
Here are some guidelines:
- In general, avoid Snaps on desktops or low-storage devices due to their large overhead. Stick to native apt packages where possible.
- However, Snaps can be useful for quick access to proprietary apps not in standard repos.
- Snaps work well for app developers wanting to distribute across distros.
- On servers, Snaps are very useful for managing app deployments.
- Be cautious of privacy issues surrounding Snap data collection policies.
- For Linux app distribution frameworks, both Snaps and Flatpaks have pros and cons.
The verdict:
Snaps are perfectly fine to use in moderation where their benefits outweigh the downsides. But don’t rely on them exclusively – continue using apt packages for most apps to conserve disk space and memory. Evaluate each app individually to decide whether to install it as a Snap or through the regular repos.
With a bit of discretion, Snaps can be beneficial in Ubuntu without introducing too many compromises. They offer an easy way to install niche proprietary apps while standard packaging handles most other software needs. Following these guidelines will help you maximize the advantages of Snaps while avoiding the pitfalls.