@Motvind No problem, you’re welcome.
I forgot to mention that none of the commands executed in the terminal should be executed as root (admin / superuser), but as yourself. E.g. if you run this command in the shell:
whoami
…the output must be the name of your account in the Linux system, instead of root. If you happen to run whoami
and the output is root, check what is your username (e.g. motvind
) and then run su username (e.g. su motvind
) in order to connect your regular user account to the Linux shell. All the shell commands below presume that you’re connected to the shell as a regular user instead of root.
I happen to be running XUbuntu 20.04 and have ffpmeg installed. However, in my case these are the DEB packages that were actually installed after I ran sudo apt install ffmpeg -y
:
-
ffmpeg version 7:4.2.4-1ubuntu0.1
-
libavcodec58 version 7:4.2.4-1ubuntu0.1
-
libavdevice58 version 7:4.2.4-1ubuntu0.1
-
libavfilter7 version 7:4.2.4-1ubuntu0.1
-
libavformat58 version 7:4.2.4-1ubuntu0.1
-
libavresample4 version 7:4.2.4-1ubuntu0.1
-
libavutil56 version 7:4.2.4-1ubuntu0.1
-
libpostproc55 version 7:4.2.4-1ubuntu0.1
-
libswresample3 version 7:4.2.4-1ubuntu0.1
-
libswscale5 version 7:4.2.4-1ubuntu0.1
Notice that all these packages are of the exactly same version 7:4.2.4.
However, when you run sudo apt install ffmpeg -y
, even though your system attempts to install ffmpeg version 7:4.2.4-1ubuntu0.1 it simultaneously attempts to install libavformat58 etc. version 7:4.3-2~18.04.york0, which is a more recent version (7:4.3-2 is greater than 7:4.2.4), it’s a set of packages designed for Ubuntu version 18.04 instead of Ubuntu 20.04 (it’s called a backport i.e. a newer application version that is however provided for a previous Ubuntu release like e.g. 18.04), and that york0 indicates that each of these packages is a modified release of version 7:4.3-2 (i.e. 7:4.3-2-ubuntu0.1 would be the official release of version 7:4.3-2 for Ubuntu 20.04, but then someone modified such package in order to make it compatible with Ubuntu 18.04 and then called it 7:4.3-2~18.04.york0 which means york0 backport modification of version 7:4.3-2 designed for Ubuntu 18.04).
So the problem here seems to be that your system found a newer version (7:4.3-2) of some (not all) of these DEB packages in repository X (which does not provide Ubuntu 20.04 packages: only 18.04 backports), and because APT did not find all required DEB packages version 7:4.3-2 in repository X, APT simultaneously attempted to install the remaining DEB packages (version 7:4.2.4) from Ubuntu’s official repository, thus causing APT to attempt a “mixed versions” (hybrid) installation of 7:4.2.4 DEBs along with 7:4.3-2 DEBs. What a mess!
Because this would break the entire ffmpeg installation (these versions 7:4.2.4 and 7:4.3-2 conflict with each other: they’re not compatible), APT prevents the installation from proceeding.
So APT searches such DEBs first in repository X because repository X provides the more up-to-date DEBs (version 7:4.3-2). However, because APT does not find all the required DEBs in such repository even though it should (the repository X is the one to blame here), APT ends up trying to fix this problem by getting the missing DEBs from Ubuntu’s official repository, even though the official repository only provides an older version (7:4.2.4), which is not compatible with the more up-to-date one (7:4.3-2).
Because repository X does not provide all required DEBs, it’s recommended to purge (remove) repository X from your system and then install everything from the official repository.
The list of Ubuntu’s official repositories of DEB packages is stored in /etc/apt/sources.list
(i.e. the list of official repositories is recorded in the sources.list
file stored at /etc/apt/
). In order to make sure that your sources.list
file contains only official Ubuntu 20.04 repositories, I asked you to backup your original file (i.e. rename it to sources.list.bak
) and then create a new (substitute) sources.list
file containing the list of official Ubuntu 20.04 repositories. This new list that you previously created is exactly the same one that’s in my own /etc/apt/sources.list
file in my system: both our systems are version 20.04, so this list serves us both.
Strangely, though, you were still unable to fix your broken DEBs after you created a “cleaned up” and reliable sources.list
file. This means that repository X is listed somewhere else: in /etc/apt/sources.list.d/
. The lists of extra (additional) repositories are stored at /etc/apt/sources.list.d/
(i.e. the directory sources.list.d
in /etc/apt/
), so repository X has to be a some-name.list
file stored at /etc/apt/sources.list.d/
. I Googled 7:4.3-2~18.04.york0 and found it in the i386 build of ffmpeg 7:4.3-2~18.04.york0 : FFmpeg 4 : Jonathon F repository, which led me to think that either you or someone with root (administrative) privileges to your Ubuntu 20.04 system added such repository to your system by running a command such as this one:
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
Hence, ppa:jonathonf/ffmpeg-4 seems to be the misterious repository X.
I added such PPA to my system just to test it. Afterwards, in order to purge such PPA repository, I ran this command:
sudo ppa-purge -p ffmpeg-4 -o jonathonf
However, the command above did not work. Hence, ppa-purge
apparently does not work in Ubuntu 20.04 and must be uninstalled by running this command:
sudo apt purge ppa-purge -y
I eventually managed to remove that PPA by running this command:
sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -r
That -r
tells APT that it must remove the PPA repository instead of adding it.
Because you have those *york0 DEBs installed, I expected that egrep
command to provide an output containing this:
/etc/apt/sources.list.d/jonathonf-ubuntu-ffmpeg-4-focal.list: deb http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu focal main
This would mean that a file jonathonf-ubuntu-ffmpeg-4-focal.list
would be located at /etc/apt/sources.list.d/
. However, the egrep
output from your system did not return such information, which is weird. I did not expect this!
Anyway… Just in case, please run:
sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -r
…just to tell your system to purge such PPA anyway.
Please also run these commands:
-
Remove any Jonathon F repository list file(s) that eventually still exist at /etc/apt/sources.list.d/
:
sudo rm /etc/apt/sources.list.d/jonathonf*
-
Also remove any Jonathon F repository list subdirectory that eventually exist at /etc/apt/sources.list.d/
:
sudo rmdir /etc/apt/sources.list.d/jonathonf*
-
Remove Jonathon F’s 1st PPA signing key (it serves to authenticate the Jonathon’s repository of application packages):
sudo apt-key del 3ADCA79D
-
Remove Jonathon F’s 2nd PPA signing key (it serves to authenticate the Jonathon’s repository of source-code packages):
sudo apt-key del F06FC659
All these steps are intended to make sure that Jonathon F’s PPA repository (i.e. repository X and all its signing keys) is completely deleted from your system.
If you get errors, don’t worry, just keep going (run the subsequent commands anyway).
Based on your provided image, I’ve also checked if either the svtplay-dl
or the plex.tv
repository provides a 7:4.3-2 york0 version of ffmpeg or one of its dependencies, but no, they do not, they’re not involved in this.
So now you should run:
sudo apt clean ; sudo apt update
…and then reinstall ffmpeg normally:
sudo apt install ffmpeg -y --reinstall
If the installation is still damaged, maybe it’s because APT is holding DEB packages in your system even though such DEBs are version 7:4.3-2 york0, which is not compatible with the other DEBs in your system. So the next attempt here is to purge each one of the problematic DEB packages. Please run each one of these commands separately, in this exact order:
-
sudo apt purge libswscale5 -y
-
sudo apt purge libswresample3 -y
-
sudo apt purge libpostproc55 -y
-
sudo apt purge libavutil56 -y
-
sudo apt purge libavresample4 -y
-
sudo apt purge libavformat58 -y
-
sudo apt purge libavfilter7 -y
-
sudo apt purge libavdevice58 -y
-
sudo apt purge libavcodec58 -y
-
sudo apt purge ffmpeg -y
Ignore errors, because some of these DEBs may be not installed.
Once you’ve purged ffmpeg’s DEB package and all its dependency DEB packages, clean up and rebuild the APT cache once more:
sudo apt clean ; sudo apt update
Check if no error is output. If any error is output, please report it here.
If no error was output, then check if there’s anything broken left to fix:
sudo apt -f install
If the above command returns any error, please report it here. But if no error is output, then perform a system upgrade just in case:
sudo apt dist-upgrade -y
Once the system is upgraded, cross fingers and then run ffmpeg’s installation command once again:
sudo apt install ffmpeg -y
If you get the very same errors as before, try forcing all these packages to the default version 7:4.2.4-1ubuntu0.1. This very long command instructs the shell to perform such task:
for i in libswscale5 libswresample3 libpostproc55 libavutil56 libavresample4 libavformat58 libavfilter7 libavdevice58 libavcodec58 ffmpeg ; do sudo apt install $i=7:4.2.4-1ubuntu0.1 -y --reinstall ; done
If you succeed in installing ffmpeg, check its version by running this command:
ffmpeg -version |grep -i "ffmpeg version"
…but if none of the above instructions worked, your system likely has a deeper issue that right now I’m unable to fathom. Anyway, in such case I recommend installing Synaptic (windowed DEB package manager) and Xapian (it creates a search database and search field inside of Synaptic’s interface):
sudo apt install synaptic apt-xapian-index -y ; sudo update-apt-xapian-index
Once you’ve installed both Synaptic and Xapian, start Synaptic from the Applications menu or straight from the shell by running this command:
pkexec synaptic
Once you’re at Synaptic’s interface, you may want to access Settings Preferences Distribution Prefer versions from, select focal-updates and click on OK, then click on Reload (a.k.a. Refresh). If you experience problems with this, try changing focal-updates to focal (a last resource is stable). Synaptic also makes it easier to search, find, select and deselect packages that you either wish to install or uninstall.