Installing VLC & running it as root on CentOS/RHEL

Hello Linux-fanatics, every now & then we must have used our RHEL/CentOS machines to play some Videos. Some of the video formats work out of the box in the default video player, called “VIDEOS” but for some formats, we are asked to install codecs & even then we have encountered one error or another.

So, in this tutorial we are going to learn to install VLC Player. VLC or VideoLan Client is an open source & very powerful media player, which supports almost all the famous audio & video formats available to us. & major advantage is that its available for all famous operating systems like Windows, Linux, Mac, Android, IOS etc.

For installing VLC media player on our machines, we need to enable 3rd Party repositories like nux-desktop or epel repository as VLC player is not present in default RHEL/CentOS repositories.

(Recommended Read: How to install UTorrent on Ubuntu Systems)

 

Enabling 3rd Party Repositories

For installing VLC media player, we can enable any of the below mentioned repositories.

RHEL/CentOS 7

  • EPEL repository

$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

  • Nux-desktop

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

RHEL/CentOS 6 (64 Bit)

  • EPEL repository

$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

  • Nux-desktop

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

 

RHEL/CentOS 6 (32 Bit)

  • EPEL repository

$ rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

  • Nux-desktop

$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-3.el6.nux.noarch.rpm

 

Note:- After you have installed the repository, run “yum clean all”  & then check for the desired package i.e. vlc

 

$ yum info vlc

vlc

Installing VLC-Player

We have seen the package info that means package is available $ can be installed. We will install VLC using yum

$ yum install vlc

It has been installed on our system& is ready to be used. To run it, you can either type

$ vlc

In bash terminal or double click on the audio/video you want to play & select VLC when asked to default player.

Note:- VLC-player can’t be used with root as a user, you have to run it as a normal user.


Running VLC-player as root

Though it is not advisable but there is a way to run VLC-player as root. I have tested this process for CentOS 6 & but same process should work on RHEL/CentOS 7 as well. If you give it a try, please share your feedbacks in comment section.

Firstly, create a backup of /usr/bin/vlc,

$ cp /usr/bin/vlc /usr/bin/vlc.bkp

This will be needed, if there might arise a problem & we have to revert back the changes made.

Next, we will install hexedit utility , which we will use to edit the file

$ yum install hexedit

after its installed, open /usr/bin/vlc with hexedit

$ hexedit /usr/bin/vlc

Next press “TAB” & then “Ctrl + s” to search ASCII string. A search box will open, where we will type “geteuid” & replace it with “getppid”. Press “Ctrl + x” to save the file. Now try to run VLC-player while logged in as root, it will work fine.

 

This completes our tutorial on installing VLC player & also run it as root user. Please mention your queries/feedback in the comment section below.

 

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of you hard earned money:

Linux TechLab is thankful for your continued support.

Shusain

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

You may also like...

2 Responses

  1. sbo says:

    Thank you, works ok in Centos 7 as root. Was having trouble with PulseAudio as another user but as root the proper audio device is shown in VLC instead of the default that does not work.

Leave a Reply

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