Feb 09 2018

How to install the VLC 3.0 snap in Linux

VLC (from the VideoLAN organization) is a popular media player, and very soon they will release version 3.

Let’s see how to install it on Ubuntu. Open up the Ubuntu Software and search for videolan. You get this.

There are two options. Which one is the DEB package, and which one is the snap. Snaps have appeared only recently, therefore they do not have many ★★★★★. Click on the name of the vlc package (the first) to investigate better.

There is a version 3.0.0-rc8, which is very fresh. Still, no definite proof that this is the snap. Go back to a shell and run the following

$ snap info vlc
name: vlc
summary: The ultimate media player
publisher: videolan
contact: https://www.videolan.org/support/
description: |
 VLC is the VideoLAN project's media player.
 
 Completely open source and privacy-friendly, it plays every multimedia file
 and streams.
 
 It notably plays MKV, MP4, MPEG, MPEG-2, MPEG-4, DivX, MOV, WMV, QuickTime,
 WebM, FLAC, MP3, Ogg/Vorbis files, BluRays, DVDs, VCDs, podcasts, and
 multimedia streams from various network sources. It supports subtitles, closed
 captions and is translated in numerous languages.
snap-id: RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd
channels: 
 stable: 3.0.0-rc8 (131) 202MB -
 candidate: 3.0.0 (156) 202MB -
 beta: 3.0.0 (155) 202MB -
 edge: 4.0.0-dev-1160-ge6d5f79 (154) 201MB -

Too many circumstantial evidence that show that we got the snap version of VLC in the earlier screenshot. Same name, summary, publisher, description and version.

But why is the name just vlc, and not VLC media player like the deb package? It looks like a (lack of a) feature of snaps that do not have a field for verbose name. The name in the snaps is a single word, that is why it’s just vlc.

We are ready to install. By the time you read this, VLC 3.0.0 should be released and made available as a snap. But even if you install the current 3.0.0-rc8, it will get auto-updated as soon as the final version is propagated from the candidate channel to the stable channel.

In the following, we see how to install VLC from Ubuntu Software, and from the command line. Both for the snaps of VLC.

How to install VLC 3.0 from the Ubuntu Software

First, let’s make sure that you have created an Ubuntu One account, and then enabled this Ubuntu One account with Ubuntu Software.

Installing VLC

Just click to install VLC.

VLC has been installed. Click on Launch to start VLC.

This is the first time that VLC (as a snap) runs. It asks for confirmation on whether it is OK for VLC to look for media metadata for the media that you are trying to play. For example, if you have a song and you play it with VLC, VLC can go grab the album picture of that song. By doing so, those services that have the album picture will know that your IP address is likely to be playing this specific song. Make your choice and click on Continue.

And here is VLC, the version that came from the snaps. Click on Media→Open File… to open a video file.

This is what you get as the default home. It is a subdirectory inside the home folder /home/user. But why? Every snap has a default location in the home directory of the user, a location to save files.

Therefore, change to your home folder and from there reach to your videos.

Enjoy VLC!

How to install VLC 3.0 from the command line

You can use the snap command to install VLC and all sort of other programs. In addition, you get some additional features that are not available yet in Ubuntu Software.

Login to Ubuntu One with snap (not prerequisite, if you do not want, skip to next section)

First of all, let’s check whether you are logged in into your Ubuntu One account.

$ snap whoami
email: -

Okay, we are not logged in. See the Troubleshooting on how to create such an account. It’s free, etc.

Then, log in into your Ubuntu One account with snap.

$ snap login
Email address: me@example.com
Password of "me@example.com": <type your Ubuntu One password and press Enter> 
Login successful
$

Installing VLC

Search for VLC as a snap.

$ snap find vlc
Name                       Version   Developer Notes Summary
vlc                        3.0.0-rc8 videolan  -     The ultimate media player
mjpg-streamer              2.0       ogra      -     UVC webcam streaming tool
simplescreenrecorder-mardy 0.3.8-3   mardy     -     Simple Screen Recorder

It is indeed called vlc. Can we get more info about vlc?

$ snap info vlc
name: vlc
summary: The ultimate media player
publisher: videolan
contact: https://www.videolan.org/support/
description: |
 VLC is the VideoLAN project's media player.
 
 Completely open source and privacy-friendly, it plays every multimedia file
 and streams.
 
 It notably plays MKV, MP4, MPEG, MPEG-2, MPEG-4, DivX, MOV, WMV, QuickTime,
 WebM, FLAC, MP3, Ogg/Vorbis files, BluRays, DVDs, VCDs, podcasts, and
 multimedia streams from various network sources. It supports subtitles, closed
 captions and is translated in numerous languages.
snap-id: RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd
channels: 
 stable: 3.0.0-rc8 (131) 202MB -
 candidate: 3.0.0 (158) 197MB -
 beta: 3.0.0-5-g407d4ba (160) 197MB -
 edge: 4.0.0-dev-1218-g201542f (159) 197MB -

The publisher of the snap is the VideoLAN team (the makers of VLC) themselves. It is great that they undertook the management of the snap, and this gives them the ability to push as fast as possible any new versions that are made available.

There is a stable version at 3.0.0-rc8. Still not 3.0.0 which is at the candidate channel.

Let’s install the stable version of VLC. If you did not log in into Ubuntu One, then run the following snap command with sudo.

$ snap install vlc
vlc 3.0.0-rc8 from 'videolan' installed
$ vlc --version
VLC media player 3.0.0-rc8 Vetinari (revision 3.0.0-rc8-0-g440b182)
VLC version 3.0.0-rc8 Vetinari (3.0.0-rc8-0-g440b182)
Compiled by jenkins on 1ac8b386a8bc (Jan 26 2018 17:00:43)
Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by the VideoLAN team; see the AUTHORS file.

That’s it.

We are working with snaps, which means that we can safely switch between channels. Let’s switch to the candidate channel of the VLC snap and then refresh, so that the change is applied.

$ snap switch --channel=candidate vlc
"vlc" switched to the "candidate" channel
$ snap refresh
vlc (candidate) 3.0.0 from 'videolan' refreshed
$ vlc --version
VLC media player 3.0.0 Vetinari (revision 3.0.0-0-gef4c265)
VLC version 3.0.0 Vetinari (3.0.0-0-gef4c265)
Compiled by jenkins on a572387dd1cf (Feb 8 2018 21:30:48)
Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by the VideoLAN team; see the AUTHORS file.

Let’s switch now to the edge channel, and try out the development version 4. Obviously, at this time, version 4 is more or less identical to the final version 3. As time passes, it will get more changes and you can test them at the safety of the snap whenever you feel like it.

$ snap switch --channel=edge vlc
"vlc" switched to the "edge" channel

$ snap refresh
vlc (edge) 4.0.0-dev-1218-g201542f from 'videolan' refreshed

$ vlc --version
VLC media player 4.0.0-dev Otto Chriek (revision 4.0.0-dev-1218-g201542f)
VLC version 4.0.0-dev Otto Chriek (4.0.0-dev-1218-g201542f)
Compiled by jenkins on 0480afbb2bb0 (Feb 9 2018 02:18:09)
Compiler: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by the VideoLAN team; see the AUTHORS file.

The version number is 4.0.0-dev-1218-g201542f and the g201542f is the shortened commit hash in the VLC git repository. Normally, you should be able to locate the exact point in the git history by adding that hash to the URL https://github.com/videolan/vlc/commit/{INSERT_HASH_HERE}. However, it did not work for me. I think the hash is added manually and there might have been a typo. Here is some other hash that works, https://github.com/videolan/vlc/commit/201542ff.

Snaps can do confinement to an application so that it protects you if something goes wrong. Therefore, how do we find what is allowed to this specific snap? Let’s get a shell into the snap and look for the snap configuration.

The snap run –shell vlc command gives you a shell with the rights of the snap (here we specified vlc). The files of the snap can be found in /snap, in a subdirectory with the same name of the snap (vlc). There can be several versions of a snap, so to get to the actual files, we go to /snap/vlc/current/. In there, we can see all the files of VLC. In meta/snap.yaml, we get the snapcraft configuration file.

$ snap run --shell vlc
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

me@mycomputer:/tmp$ cd /snap/vlc/current/
me@mycomputer:/snap/vlc/current$ find . -name "*.yaml"
./meta/snap.yaml
me@mycomputer:/snap/vlc/current$ cat meta/snap.yaml 
name: vlc
version: 3.0.0-rc8
summary: Read, capture, broadcast your multimedia streams
description: |
 VLC is a free and open source cross-platform multimedia player and
 framework that plays most multimedia files as well as DVDs, Audio CDs,
 VCDs, and various streaming protocols.
 NOTE. This snap contains an untested daily build of VLC
architectures:
- amd64
confinement: strict
grade: stable
apps:
 vlc:
 command: command-vlc.wrapper
 plugs:
 - unity7
 - network
 - network-bind
 - home
 - opengl
 - pulseaudio
 - mount-observe
 - optical-drive
 - camera
 - removable-media
 - screen-inhibit-control
 - x11
 - desktop
 - desktop-legacy
 slots:
 - mpris
me@mycomputer:/snap/vlc/current$

First, the confinement is strict. This means that the app can do only what is explicitly listed in the plugs. These plugs come from the list of Interfaces at snapcraft.io. Here are the most important of them,

  • home, access to the home folder of the user.
  • network, network-bind, access the Internet as a client, access the network/Internet as a server
  • removable-media, optical-drive, access to USB sticks (any removable media) and optical disks.
  • mount-observe, list mounts
  • opengl, x11, desktop, access to the desktop, with hardware acceleration for the graphics card.
  • mpris, this adds the facility to control remote media servers (playback, etc).

In the same way, you can find information about other snaps.

Troubleshooting

Help! What is an Ubuntu One account?

An Ubuntu One account is an account that helps you do more things with snaps. You can avoid setting up an Ubuntu One account, however you will end up using desktop password more often than one. That is, if you are already logged in into your Ubuntu One account, then you can run snap commands without having to type your password.

To create an Ubuntu One account, visit the page at One account to log in to everything on Ubuntu. Here is how it looks.

Fill in the details in order to create an Ubuntu One account.

If you already have an account, select the option I am a returning user to log in. If you have forgotten your password, you can use the link to reset your password. That link appears on the screen where you log in.

Help! Ubuntu Software asks me to log in into Ubuntu One!

With the new Ubuntu Software (based on Gnome Software), you are prompted to log in when you install your first snap. Therefore, if you are ever prompted to log in to Ubuntu One, here is how to do it.

This window will appear asking you to type in your email and password. You can also sign in automatically in the future. There is the option to register a new Ubuntu One account from here, and also to get a reminder for the password. Once you fill in the information, click on Continue (button that is located at the top right).

Help! This window is not responding in Ubuntu Software!

Note that this is Ubuntu Software that starts another program to get you to log in. You might get the following warning if it takes you a bit to fill in the information. In this case, simply click on Wait and continue with the log in process.

Help! I have some videos in /tmp and VLC cannot find them!!!

Indeed, I have put some videos in /tmp and here is what VLC can see,

The developers of VLC that created the snap have opted to use a reasonable confinement to the snap, so that the media player does not get access to files outside of the home directory of the user. It is part of the features of snaps, and helps protect your system. Therefore, if you have videos to play, make sure they reside in your home directory.

Help! I try to “snap install vlc” and I get “error: access denied (try with sudo)”!

When you try to install snaps and you get “error: access denied (try with sudo)”, then this means that you did not log in into your Ubuntu One account using snap login. Check up in this post on how to do this.

Help! I try to run vlc from the command line, and all I get is “The program ‘vlc’ is currently not installed.”

You can get this issue if you just installed vlc and your shell does some caching of the list of executables.

If you run the bash shell, then execute hash -r to refresh the list of known executables. If you use *csh, then the command is rehash.

Help! I still have the old VLC that was installed with apt-get. How do I remove that?

You can remove with the following. It removes the vlc binary, along with the vlc command line package (if it exists).

$ sudo apt remove vlc vlc-nox

Permanent link to this article: https://blog.simos.info/how-to-install-the-vlc-3-0-snap-in-linux/

6 comments

Skip to comment form

  1. Nice comprehensive post as always Simon! 😀
    You don’t actually need to sign up for Ubuntu One to install snaps anymore. Simply “sudo snap install vlc” is enough on a clean system.

    1. Thanks Alan!
      When you log in with snap to the Ubuntu One account, you avoid using “sudo” which I think it good.
      I’ll make it clear that there is the option to go by using “sudo”.

    • timo on February 9, 2018 at 10:13
    • Reply

    so how about network shares, no way to open files from there?

    1. Network shares are fine.I found the snap configuration of VLC and it explicitly enables them.
      I’ll make an addition to the post about this.

    • Gustav on February 9, 2018 at 12:36
    • Reply

    I have vlc installed through apt, if I install the snap.. I’m still getting the old version (2.2). Do I have to uninstall through apt first?

    1. You can remove the old VLC from either

      1. The Ubuntu Software. Search for VLC and click to remove. See the screenshots to identify the correct package (the one with the stars).

      2. Or, run the following command,

      sudo apt remove vlc

      I have just added this to the Troubleshooting section.

Leave a Reply

%d bloggers like this: