尝试(重新)安装 ffmpeg,但未满足依赖关系

尝试(重新)安装 ffmpeg,但未满足依赖关系

我之前尝试过https://ubuntuhandbook.org/index.php/2022/02/install-ffmpeg-5-0-ubuntu/在 ubuntu 20.04 LTS 上安装 ffmpeg 5 时,没有成功。现在我升级到了 Ubuntu 22.04.2 LTS(它本身也存在问题)。但我仍然无法正确安装 ffmpeg;

sudo apt install ffmpeg 
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:
 ffmpeg : Depends: libavcodec58 (= 7:4.4.2-0ubuntu0.22.04.1)
          Depends: libavdevice58 (= 7:4.4.2-0ubuntu0.22.04.1) but 7:4.4.3-0ubuntu1~20.04.sav2 is to be installed
          Depends: libavfilter7 (= 7:4.4.2-0ubuntu0.22.04.1)
          Depends: libavformat58 (= 7:4.4.2-0ubuntu0.22.04.1)
          Depends: libavutil56 (= 7:4.4.2-0ubuntu0.22.04.1) but 7:4.4.3-0ubuntu1~20.04.sav2 is to be installed
          Depends: libpostproc55 (= 7:4.4.2-0ubuntu0.22.04.1) but 7:4.4.3-0ubuntu1~20.04.sav2 is to be installed
          Depends: libswresample3 (= 7:4.4.2-0ubuntu0.22.04.1) but 7:4.4.3-0ubuntu1~20.04.sav2 is to be installed
          Depends: libswscale5 (= 7:4.4.2-0ubuntu0.22.04.1) but 7:4.4.3-0ubuntu1~20.04.sav2 is to be installed
E: Unable to correct problems, you have held broken packages.

当我现在拥有 22 版本时,apt 尝试安装 20 版本的依赖项,这是怎么回事?

答案1

我使用了此主题并在 ChatGPT-4 的帮助下,使用以下命令修复了该问题:

# remove the savory1 PPA:
sudo rm /etc/apt/sources.list.d/savoury1-ubuntu-ffmpeg*

# not sure if these were necessary, but can't hurt
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

# manually install the packages over the existing savory1 ones:
sudo apt-get install libavcodec58=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libavdevice58=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libavfilter7=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libavformat58=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libavutil56=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libpostproc55=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libswresample3=7:4.4.2-0ubuntu0.22.04.1
sudo apt-get install libswscale5=7:4.4.2-0ubuntu0.22.04.1

# install ffmpeg
sudo apt-get install ffmpeg

它是显然因为 savory1 决定开始向人们收取 PPA 费用:

(2023 年 3 月 24 日):此 Launchpad 网站上的 PPA 现已转向仅限订阅者(已捐款的人)的系统。考虑到有多少人和企业正在使用这些我投入数千小时精力创建的 PPA,以及这么多人和企业的捐款数额微乎其微,为了我的生存,现在有必要将这些 PPA 上最受欢迎的软件的访问权限限制为支持者。

答案2

按照建议的问题建议表https://askubuntu.com/a/60314/1030659 sudo aptitude install ffmpeg 让我选择未满足的依赖项并从 ubuntu20 版本“降级”到 ubuntu22 版本。我现在有一个定期安装的 ffmpeg ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers

但遗憾的是这仍然不是 ffmpeg 版本 5,但这确实解决了我的麻烦。

答案3

美味的 FFmpeg5 PPA现在我引用一下:

*** 安装 ***

此处的 FFmpeg 构建依赖于公共 FFmpeg PPA (ppa:savoury1/ffmpeg4) 和新的私有 FFmpeg PPA (ppa:savoury1/ffmpeg) 进行安装。任何捐赠者都可以联系我,请求访问私有 PPA。获得私有 PPA 访问权限后,请执行以下步骤进行安装:

sudo add-apt-repository ppa:savoury1/ffmpeg4
sudo add-apt-repository ppa:savoury1/ffmpeg5
sudo apt-get update
sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install ffmpeg

因此需要向作者捐款,然后联系他(罗布·萨沃里)被授予访问他的ppa:savoury1/ffmpeg私人电力购买协议 (PPA)进入你的启动板订阅. 需要安装此私有 PPAffmpeg及其依赖项:

$ listInstalledPackagesFromRepo savoury1/ffmpeg
ffmpeg
libavcodec58
libavdevice58
libavfilter7
libavformat58
libavutil56
libde265-0
libdjvulibre-text
libdjvulibre21
libglslang12
libheif1
libilbc3
libjasper7
liblerc-dev
liblerc3
libplacebo264
libpostproc55
librav1e0
libraw20
librist4
libshaderc1
libsvtav1enc1
libswresample3
libswscale5
libtiff-dev
libtiff5
libtiffxx5
libvapoursynth
libvapoursynth-script0
libvmaf1
libvulkan1
libzip4
vapoursynth-python3
vulkan-tools
$ /usr/bin/ffmpeg -version
ffmpeg version 5.1.3-0ubuntu1~20.04.sav0 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version='0ubuntu1~20.04.sav0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-amf --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-sndio --enable-pocketsphinx --enable-librsvg --enable-libdav1d --enable-libilbc --enable-libjxl --enable-librist --enable-vapoursynth --enable-libvmaf --enable-libzimg --enable-crystalhd --enable-libmfx --enable-libsvtav1 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100
$

相关内容