How to run snap explicitly

My system is Ubuntu 14.04.

When a snap is installed, you can run the program in it by guessing its name and running it. What if you have another program of the same name installed? How can you choose which one is run?

VLC 2.1.6 is already installed on my machine, using apt-get. That’s the version in the Ubuntu repos.
Today, snapcraft has version 3.0.4, so I did snap install vlc and it seemed to install OK.
However when I run vlc, or select VLC media player from the Unity menu thing, I get version 2.1.6. How can I make sure to run the snap version?

I would just apt-get remove vlc and then presumably only the snap version would be left, but doing so removes the familiar VLC app and leaves behind some strange command-line VLC when I run vlc. I could fiddle around working out where that comes from and remove it – but it seems likely that there’s a reliable way to do run the snap version explicitly, in the general case, in case the name is already used.

1 Like

Hm, this is tricky. I considered whether one could temporarily watermark the snap icons as a personal preference. However the icons are all inside the snap and as such are read only. An alternative might be to modify the .desktop file in /var/lib/snapd/desktop/applications/ to add some text to the description, but that will get over-written on each snap refresh. So we don’t have a good solution there.

One suggestion I expect people will have is to enforce a " - Snap" suffix on the description in the snap on install. But this would look horribly messy in menus, and is largely irrelevant. Typically a user would only have one instance of an app installed and don’t care where it came from or how it’s packaged. But I appreciate some do want multiple copies installed from different locations (I have this setup myself for some apps).

You can explicitly run snap version of certain app by running snap run _snap_name_ or snap run _snap_name_._app_name_ in the terminal.

For my personal packaged apps that features a menu entry, I apply a patch that append ‘(Snappy Edition)’ string to the entry name, this doesn’t apply to other packager though.

1 Like

Thanks Lin-Buo-Ren - that seems to work. (I can’t actually run the program due to my other problem but at least it gives the same error, indicating that it’s trying to run the same thing.