This is a companion discussion topic for the original entry at https://linuxconfig.org/install-ffmpeg-on-ubuntu-18-04-bionic-beaver-linux
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?
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.
I did update before trying, but still gave the error described above.
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.
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!
Hi Rafael Herrero,
That would mean if this is a fresh install of 18.04 you downgraded your source list somehow to 16…?
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?