I installed ffmpeg using this command

sudo apt-get install ffmpeg

After the installation i tried this command in terminal


but i got error message like this

root@client85-desktop:~# ffmpeg
bash: /usr/local/bin/ffmpeg: cannot execute binary file

How can i solve this issue?


The path /usr/local/bin/ indicates, that you have installed a custom version of ffmpeg. The version you have installed with apt-get install is located at /usr/bin/ (without the "local" part). To execute the version apt-get has installed, run


You can remove /usr/local/bin/ffmpeg or mark it as non-exexcutable with sudo chmod -x /usr/local/bin/ffmpeg. Run hash -r so the change takes effect in the current shell. Log out and log back in so that the change takes effect for every graphical application.

As soon as /usr/local/bin/ffmpeg has been treated with one of the above mentioned method, simply calling ffmepg will start the one at /usr/bin/ffmpeg by default.

Edit Added information from @Ramchandra_Apte on how to do this without a complete reboot.

  • 1
    Suggestion a reboot seems a bit overkill, simply opening a new shell should do it, right? – user50849 Oct 14 '13 at 15:50
  • 2
    @user50849 You don't even need to reboot; simply run hash -r. – Ramchandra Apte Oct 14 '13 at 15:51
  • You mean "don't even need a new shell", I assume? Good to know, I didn't know what the command was to refresh the current environment, so I suggested a new shell, but hash -r is even better. :) – user50849 Oct 14 '13 at 15:53

Yeah something isn't quite right here. If you install ffmpeg, its binary is installed to /usr/bin/ffmpeg, not /usr/local/bin/ffmpeg.

So the first assumption I have to make is either:

  • You've installed a non-standard ffmpeg package
  • Something else has included a weird local and broken copy of ffmpeg for some reason.

First see if /usr/bin/ffmpeg will run. If it does, at least you've probably got the proper ffmpeg installed and we can just focus on removing the dud copy. If you don't, you've gone and got yourself a dodgy copy. I'm not you, I don't know what you've done but remove dodgy repositories and generally clean house.

Now let's see if there's a package associated with this /usr/local/bin/ffmpeg version

dpkg -S /usr/local/bin/ffmpeg

That will either tell you it hasn't found anything or it will tell you which package it came from. If there's a package, sudo dpkg -r <package name> and try ffmpeg again.

If there's no package you're left in the unenviable spot of needing to manually remove it. If you've built this from source, you can cd into the source directory and run a sudo make uninstall. If you still claim not to know where this came from you can try a sudo rm /usr/local/bin/ffmpeg but I can't say what effect that may have on other applications if this is something that they've done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.