Install FFmpeg on Ubuntu 18.04 Bionic Beaver Linux - LinuxConfig.org


#1
The objective is to Install FFmpeg on Ubuntu 18.04 Bionic Beaver Linux. This guide will provide you with an information on how to install FFmpeg on Ubuntu 18.04 from a standard Ubuntu repository as well as how to install latest FFmpeg by compiling it from a source.
This is a companion discussion topic for the original entry at https://linuxconfig.org/install-ffmpeg-on-ubuntu-18-04-bionic-beaver-linux

#2

Hi, thanks for your guide, i was trying to install ffmpeg via apt on a Ubuntu 18.04 fresh install but i get the following error:
$ sudo apt install ffmpeg
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ffmpeg : Depends: libavcodec-ffmpeg56 (>= 7:2.7) but it is not going to be installed or
                   libavcodec-ffmpeg-extra56 (>= 7:2.7) but it is not going to be installed
          Depends: libavdevice-ffmpeg56 (>= 7:2.6) but it is not going to be installed
          Depends: libavfilter-ffmpeg5 (>= 7:2.4) but it is not going to be installed
          Depends: libavformat-ffmpeg56 (>= 7:2.6) but it is not going to be installed
          Depends: libswresample-ffmpeg1 (>= 7:2.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If i run
sudo apt-mark showhold
i see no packages hold.
Is it some ffmpeg bug or Ubuntu bug?


#3

Hi Rafael Herrero,

Welcome to our forums.

Since you say you would like to install ffmpeg on a fresh install of Ubuntu, I’d advise to update it to the latest packages first, before installing anything. Solves a lot of problems, since repositories tend to provide many versions of a package, but your fresh install may not be able to install the most current until updating the system.


#4

Thanks sandmann,
I did update before trying, but still gave the error described above.


#5

I managed to fix my problem with the following command:
sudo apt install ffmpeg libavcodec-ffmpeg56 libavdevice-ffmpeg56 libavfilter-ffmpeg5 libavformat-ffmpeg56 libswresample-ffmpeg1 libsoxr0 libgomp1 gcc-5-base=5.4.0-6ubuntu1~16.04.10

The issue was on the version of gcc-5-base by default it was going to install one newer than the required by ffmpeg.
Thanks.


#6

Found the real problem, i had done do-release-upgrade and my /etc/apt/sources.list were a mess, i replaced them with the right ones and that fixed the problem!


#7

Hi Rafael Herrero,

That would mean if this is a fresh install of 18.04 you downgraded your source list somehow to 16…?


#8

Hi. I was able to complete each process without a problem but this $ ffmpeg -version, returns this:

Command ‘ffmpeg’ not found, but can be installed with:

sudo apt install ffmpeg

All processes were completed without errors. So, what now?