How to Install Snap Packages on Ubuntu

Hi, If you’re using Ubuntu, you’ve likely come across Snap. It’s one of the best package manager when it comes to installing software, especially if you want a hassle-free experience. Whether you’re new to Ubuntu or just haven’t tried Snap yet, I will cover everything you need to know about Snap packages like how to install them, manage them, and troubleshoot common issues.

Snap is designed to simplify software management, and trust me, once you get the hang of it, you’ll wonder why you ever used anything else. It’s particularly useful for keeping your system updated with the latest software versions while avoiding dependency headaches. Ready to learn now?

What is Snap and Why Use It?

I don’t know if you know or not but Snap is a universal package format developed by Canonical, the maker of Ubuntu. The main benefit? It packages an application along with all its dependencies also, so it runs consistently across many Linux distributions. Whether you’re using Ubuntu, Fedora, or Arch, Snap ensures that the app will run smoothly without compatibility issues.

So here is why you might want to use Snap:

  • Automatic Updates: Snap packages automatically update in the background when the system is turned on and connected to the Internet. No more worrying about whether you’re running the latest version.
  • Enhanced Security: Snap applications run in a sandbox, meaning they are isolated from your system. This provides an extra layer of security. Isn’t it great?
  • Cross-Platform Compatibility: Snap is not just for Ubuntu; it works across multiple Linux distributions, making it versatile and more useful.

Installing Snap on Ubuntu

In Order to use snap it’s important to have snap installed on your system. But If you are running Ubuntu 16.04 or later, Snap is pre-installed, so you can skip this part. But if you’re using an older version or if Snap has been removed from your system for any reason, follow these steps to install it.

  1. Open Terminal: Hit Ctrl + Alt + T to launch your terminal or you can open as regularly open it.
  2. Update Your Package List: Always a good idea to ensure your system is up-to-date. Type: sudo apt update on your Ubuntu terminal.
  3. Install Snapd: Snapd is the service that manages Snap packages. Install it by typing: sudo apt install snapd
  4. Enable Snapd: If it’s not running by default, enable Snapd with: sudo systemctl enable --now snapd.socket

You are all set! Now that Snap is installed, you are ready to start installing applications.

How to Install Snap Packages

Installing a Snap package is incredibly easy. Here’s a real-world example. let’s say you want to install VLC media player using Snap.

  1. Find the Snap Package:
    Use the snap find command to search for the app you want. For VLC, you’d type:
snap find vlc

This command will list available versions and a short description.

  1. Install the Package:
    Once you have found the app, install it with the sudo snap install command:
sudo snap install vlc

That’s it, Snap will download the package along with all its dependencies, and VLC will be ready to use.

  1. Verify Installation:
    To confirm that the package is installed, simply run:
snap list

This will display all the Snap packages currently installed on your system.

Managing Snap Packages

Once you have installed Snap packages, managing them is a breeze. Here are some handy commands that you can try:

  • Update Your Snaps: While Snap automatically updates your apps, you can manually update them by typing the following command also:
sudo snap refresh

This ensures that you have the latest version of all installed Snap apps.

  • Uninstall a Snap Package: Sometimes you may want to remove apps from your system because you don’t use them frequently. So in such a case, you can run the following command:
sudo snap remove app_name
  • Check the Snap Version: If you are curious about which version of Snap is running on your system, use:
snap version

Snap Alternatives

While Snap is convenient, it’s not the only option for installing applications on Ubuntu. Here are some alternatives:

  • APT (Advanced Package Tool): APT is Ubuntu’s default package manager and works for installing software from the official repositories. While it doesn’t bundle dependencies like Snap, it’s lighter and faster. When it comes to install packages from Ubuntu’s official repo then APT is great. But yes, it’s not necessary that you will find all the apps in the official repo.
  • Flatpak: Like Snap, Flatpak is a universal package format that works across different Linux distributions. It’s known for sandboxing apps and providing the latest versions without needing root access.
  • AppImage: AppImage is a portable package format. You can download an AppImage file, make it executable, and run it without needing to install it. It’s a great choice for users who want a completely self-contained app.

Each of these alternatives has its own pros and cons, but Snap stands out for its ease of use and security features.

Troubleshooting Snap: How to Fix Common Errors

While Snap is designed to be simple, you might run into a few issues. Here’s how to fix some common Snap errors:

  1. Snap Command Not Found:
    If you get a “command not found” error, it likely means Snap is not installed. Reinstall it by following the steps above.
  2. Package Not Found:
    Sometimes Snap won’t be able to find the package you’re looking for. In this case, check if the package name is correct or visit the Snapcraft store to confirm availability.
  3. Slow Downloads:
    If you notice that Snap packages are downloading slowly, it might be due to network congestion or server load. Patience is key here, as waiting a few minutes often resolves the issue.
  4. Permission Issues:
    Some Snap packages may have restricted permissions that limit their functionality. You can adjust permissions with the following command:
sudo snap connect <snap-package>:<plug>

This ensures the app has the necessary permissions to function correctly.

Table 1: Common Snap Commands and Their Functions

CommandFunction
sudo snap install <package>Installs a Snap package
sudo snap remove <package>Removes a Snap package
sudo snap refreshUpdates all Snap packages
snap listLists installed Snap packages
snap find <package>Searches for a Snap package

Table 2: Comparison of Package Managers

FeatureSnapAPTFlatpak
Cross-DistroYesNoYes
SandboxingYesNoYes
Auto-UpdatesYesNoNo
Bundles DependenciesYesNoYes

Frequently Asked Questions (FAQs)

What makes Snap different from APT?

Snap bundles all dependencies, so the app works out of the box on any Linux distro. APT relies on system libraries and can sometimes lead to dependency issues.

How can I fix Snap if it stops working?

Try restarting the Snap service by running: sudo systemctl restart snapd If that doesn’t work, reinstalling Snap might help.

Are Snap packages slower than regular packages?

Snap packages can sometimes take a bit longer to start because of the extra layer of isolation. However, the security and ease of use make up for this.

Can I use Snap and Flatpak at the same time?

Yes, you can install both Snap and Flatpak on the same system without any conflicts.

How do I uninstall Snap from my system?

If you no longer wish to use Snap, uninstall it by running: sudo apt remove snapd This will completely remove Snap from your system.

Conclusion

Snap simplifies software installation on Ubuntu, making it easy to stay up-to-date with the latest versions of your favorite apps. Whether you are new to Linux or a seasoned user, Snap provides a secure, efficient way to manage your software. Don’t forget to regularly run sudo snap refresh to ensure everything stays updated.

Final Takeaway: While Snap is powerful and user-friendly, remember that you have alternatives like APT and Flatpak. Explore each option to find what works best for your setup!

Now, go ahead and install that Snap package you have been thinking about, you will not regret it.

Deepak Maurya

About the Author: Deepak Maurya

I hold a Computer Science degree, which built my skills in programming and system administration. Over time, my passion for Linux grew, not just for its tech power but because of the supportive community around it. Writing about Linux, especially Ubuntu, lets me share what I’ve learned. I understand how challenging it can be to start with something as flexible as Linux, so my aim is to simplify complex topics for everyone, no matter their skill level.

Full Bio »

Leave a Comment