Package incompatibilities in Ubuntu 22.04
Repro steps:
- sudo apt update && sudo apt upgrade
- sudo apt autoremove && sudo apt autoclean
- add the app for vlc
- sudo apt-get install vlc > error, failed with the following terminal logs:
Reading package lists... Done
Building dependency tree... Done
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:
libchromaprint1 : Depends: libavcodec58 (>= 7:4.4)
Depends: libavutil56 (>= 7:4.4) but it is not installable
libpostproc55 : Depends: libavutil56 (= 7:4.4.2-0ubuntu0.22.04.1) but it is not installable
libswscale5 : Depends: libavutil56 (= 7:4.4.2-0ubuntu0.22.04.1) but it is not installable
libva-wayland2 : Depends: libva2 (< 2.14.0.1) but 2.14.0.2-29 is to be installed
libva-x11-2 : Depends: libva2 (< 2.14.0.1) but 2.14.0.2-29 is to be installed
vlc-plugin-base : Depends: libavcodec58 (>= 7:4.4)
Depends: libavformat58 (>= 7:4.4)
Depends: libavutil56 (>= 7:4.4) but it is not installable
Depends: libva-drm2 (>= 1.1.0) but it is not installable
vlc-plugin-video-output : Depends: libavcodec58 (>= 7:4.4)
Depends: libavutil56 (>= 7:4.4) but it is not installable
Depends: libva-drm2 (>= 1.1.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
- Attempt to install the first package in the list: sudo apt-get install libavcodec58 > fails with the following logs:
Reading package lists... Done
Building dependency tree... Done
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:
libva-drm2 : Depends: libva2 (< 2.14.0.1) but 2.14.0.2-29 is to be installed
libva-x11-2 : Depends: libva2 (< 2.14.0.1) but 2.14.0.2-29 is to be installed
E: Unable to correct problems, you have held broken packages.
- Thus, libva2 needs to be installed/downgraded manually, as the newest package is installed by default after running the latest update/upgrade (steps 1,2) > proceed to install this package from debian. Issue solved.
Installing VLC from snap will not solve this, as it will not play .mp4 movies due to missing codecs. Installing the missing codecs will make the user face the same package incompatibility issues as above. This missing codec error led me to remove the snap package and attempt to install it from the ppa only to run in the same issues.