3

I installed VLC through terminal but it shows:

bash: /snap/bin/vlc: No such file or directory

I also tried:

which vlc

and it showed:

/usr/bin/vlc

When I try to run it through sudo su, it shows this error:

VLC is not supposed to be run as root. Sorry.
If you need to use real-time priorities and/or privileged TCP ports
you can use vlc-wrapper (make sure it is Set-UID root and
cannot be run by non-trusted users first).

Any idea how I can fix this issue?

I tried using the snap VLC package, which I installed using the terminal, but I couldn't navigate to my Downloads folder. I could only navigate in the "computer" folder, which consists of /bin, /usr, /var, etc. I was able to play the items of the folder I wanted by dragging and dropping.

I'm also only able to open VLC through the terminal. Opening it through the start menu doesn't do anything.

I'm using Zorin OS 16, which is based on Ubuntu 20.04, if I'm not wrong.

3
  • 1
    You may also want to set up an alias. If you type gedit ~/.bash_aliases you will see an editor with a file in it. The file may or may not be blank. At the bottom, add alias vlc=/usr/bin/vlc. Be sure not to change anything else. Now, when you type vlc, it will run /usr/bin/vlc. You can do this with any command, or set of commands, that you use often, to shorten the amount of characters that need typed. In case that doesn't work in zorin, add to ~/.bashrc, but try ~/.bash_aliases first. Commented Sep 24, 2021 at 11:13
  • tysm this worked like a charm! how do i mark this as answer? Commented Sep 24, 2021 at 15:49
  • 1
    Tysm is mark enough. Glad it helped you. Commented Sep 24, 2021 at 20:00

3 Answers 3

6

You should run

$ /usr/bin/vlc

As for why executing vlc looks for /snap/bin/vlc, I wouldn't know. If you had a snap for vlc installed, I guess it should have worked as well.

Perhaps you have an alias set in your ~/.bashrc or elsewhere. If you find such an alias, and remove it, you could probably start running vlc without the need for prepending the full path.

EDIT

To remove the difficulty, you could check if you actually have any file or soft link /snap/bin/vlc. Check with

$ type vlc
$ ls -al /snap/bin/vlc

Also, you could setup your own alias vlc=/usr/bin/vlc in ~/.bashrc. If that is read after the presumed other alias, you would be ok.

7
  • this fix worked thanks! im new to ubuntu could you guide me through removing this alias? i tried opening .bashrc in terminal using sudo it still says permission denied... Commented Sep 24, 2021 at 11:03
  • @HaadeeBinHafees Have you removed the snap VLC before installing the deb version? Commented Sep 24, 2021 at 11:13
  • @HaadeeBinHafees - Please see updated answer. Notes: 1) Instead of narrating what you did ("i tried opening .bashrc in terminal using sudo"), post the exact command. 2) Instead of narrating what you obtained ("it still says permission denied"), post the exact and complete output. 3) If this solved your problem, please accept the answer. Whether you had installed/removed the snap, etc., is a separate issue. Commented Sep 24, 2021 at 13:53
  • i typed ~/.bashrc and its output was bash: /home/zorin16/.bashrc: Permission denied i then tried going into sudo su and typed ~/.bashrc again and its output was bash: /root/.bashrc: Permission denied i realise my problem was not using gedit. i was confused as i couldnt find the file in my 'computer' folder... Commented Sep 24, 2021 at 15:54
  • @ChanganAuto yes i removed snap vlc before installing deb version which i assume is the apt-install version? Commented Sep 24, 2021 at 16:00
4

Originally posted as a comment by Nate T:

You may also want to set up an alias, as well.

If you type gedit ~/.bash_aliases, you will see an editor with a file in it. The file may or may not be blank.

At the bottom (or the top if the file is empty), add the following:

alias vlc=/usr/bin/vlc

Be sure not to change anything else. Now, when you type vlc in the terminal, it will run the command /usr/bin/vlc.

You can do this with any command, or set of commands that you use often, to shorten the amount of characters that need typed.

In case this doesn't work in your current environment (and the file you edited earlier was blank), run the following command:

printf '\n\nif [ -f ~/.bash_aliases ]; then\n    source ~/.bash_aliases\n fi\n\n' >> ~/.bashrc && source ~/.bashrc 

This will add the needed code to the proper file, in order to source the .bash_aliases file.

You can also add the line to ~/.bashrc, but save this option to be used only as a last resort, in case you cannot get it to work using ~/.bash_aliases.

0
0

If you had VLC installed as snap, removed it, and then re-installed it via apt(-get), your error means that the location table still uses an old entry. That issue was raised and solved here on SuperUser

You can confirm this by typing:

type vlc

and it may print something like vlc is hashed (/snap/bin/vlc). So, all you should have to do is type this in the terminal once:

hash vlc

Note that this will produce no output message. After that, run vlc as normal and it should work.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.