我有一台全新的联想 Ideapad,我刚刚在上面安装了 KUbuntu 23.04。但是,包管理器并没有更新所有内容。具体来说,三个与 GStreamer 相关的包都无法更新。
具体警告信息为:
软件包安装失败:安装软件包时出错:尝试覆盖“/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcamerabin.so”,该软件包也在 gstreamer1.0-plugins-good 中
建议稍后再试,但如果它试图覆盖包,我不确定是否会产生任何影响。
当我尝试删除 GStreamer 并从头开始重新安装它时(sudo apt remove gstreamer1.0-plugins-good
),系统会显示缺少依赖项的列表,并建议我运行“apt --fix-broken install”,这将下载大约 700 kB。这很好,但在执行此操作时,它再次因相同的错误而停止。
--fix-broken 之后的逐字内容:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libbdplus0 libdca0 libdirectfb-1.7-7 libfaad2 liblrdf0 libmjpegutils-2.1-0 libmpeg2-4 libmpeg2encpp-2.1-0
libmplex2-2.1-0 libneon27 libopenni2-0 libpocketsphinx3 libsidplay1v5 libsphinxbase3 libssh-gcrypt-4
libvidstab1.1 linux-headers-6.2.0-20 linux-headers-6.2.0-20-generic linux-image-6.2.0-20-generic
linux-modules-6.2.0-20-generic linux-modules-extra-6.2.0-20-generic pocketsphinx-en-us
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
Suggested packages:
frei0r-plugins libvisual-0.4-plugins
The following packages will be upgraded:
gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
3 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
102 not fully installed or removed.
Need to get 0 B/4,619 kB of archives.
After this operation, 700 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 260527 files and directories currently installed.)
Preparing to unpack .../gstreamer1.0-plugins-bad_1%3a1.22.3-dmo1+deb12u1_amd64.deb ...
Unpacking gstreamer1.0-plugins-bad:amd64 (1:1.22.3-dmo1+deb12u1) over (1.22.1-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/gstreamer1.0-plugins-bad_1%3a1.22.3-dmo1+deb12u1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstcamerabin.so', which is also in package gstreamer1.0-plugins-good:amd64 1.22.1-1ubuntu1
Preparing to unpack .../libgstreamer-plugins-bad1.0-0_1%3a1.22.3-dmo1+deb12u1_amd64.deb ...
Unpacking libgstreamer-plugins-bad1.0-0:amd64 (1:1.22.3-dmo1+deb12u1) over (1.22.1-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libgstreamer-plugins-bad1.0-0_1%3a1.22.3-dmo1+deb12u1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libgstbasecamerabinsrc-1.0.so.0', which is also in package libgstreamer-plugins-good1.0-0:amd64 1.22.1-1ubuntu1
dpkg: regarding .../libgstreamer-plugins-base1.0-0_1.22.3-dmo1+deb12u2_amd64.deb containing libgstreamer-plugins-base1.0-0:amd64:
libgstreamer-plugins-base1.0-0:amd64 conflicts with libgstreamer-plugins-bad1.0-0 (<< 1:1.16.0)
libgstreamer-plugins-bad1.0-0:amd64 (version 1.22.1-1ubuntu1) is present and installed.
dpkg: error processing archive /var/cache/apt/archives/libgstreamer-plugins-base1.0-0_1.22.3-dmo1+deb12u2_amd64.deb (--unpack):
conflicting packages - not installing libgstreamer-plugins-base1.0-0:amd64
Errors were encountered while processing:
/var/cache/apt/archives/gstreamer1.0-plugins-bad_1%3a1.22.3-dmo1+deb12u1_amd64.deb
/var/cache/apt/archives/libgstreamer-plugins-bad1.0-0_1%3a1.22.3-dmo1+deb12u1_amd64.deb
/var/cache/apt/archives/libgstreamer-plugins-base1.0-0_1.22.3-dmo1+deb12u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
它与其他命令相同,但如果有人需要具体信息,我可以查阅。
笔记本电脑/绘图板运行正常,但我真的很想解决这个问题,而且我个人已经没有什么主意了。有人能指点我下一步该怎么做才能解决这个问题吗?
我安装的唯一软件是 Krita、Blender 3.6(直接下载,而不是通过 repo)和通过 snap 的 OpenToonz。这是一台特别新的机器,除了安装 KUbuntu 之外,我从未亲自在上面安装过 GStreamer。
答案1
所以,它终于可以正常工作了,虽然很难确定,但问题似乎源于 Snap。
我继续尝试卸载所有导致问题的东西。很快就出现了一个列表:
sudo apt remove gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-pulseaudio gstreamer1.0-x libgstreamer-gl1.0-0 phonon4qt5-backend-gstreamer gstreamer1.0-gl libgstreamer-plugins-bad1.0-0 libgtk-4-media-gstreamer libqt5multimediagsttools5 libqt5multimedia5-plugins elisa
但我推断,如果依赖项缺失或损坏,那么无论如何我都无法充分利用它。然而,phonon
最终却引发了另一个无法修复的 ourouborous 类型的错误。因此,我插入了原来的 LiveUSB,并尝试尽可能不造成破坏地重新安装 KUbuntu。
系统文件和设置都保留了下来,包括配置文件。我做的第一件事就是安装所有可用的更新,然后我又回去工作了。Blender 仍然在那里,因为我刚刚抓取了二进制文件,这是我的习惯。Krita 需要通过 Discover Software Center 重新安装,但它记住了我的所有设置和文档,这很棒。
我甚至重新启动了系统,以确保旧的 GStreamer 错误没有出现。因此,我继续尝试使用 flatpak 而不是 snap 安装 OpenToonz。我必须添加 flathub:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
之后,我可以简单地安装 OpenToonz 所需的 flatpak 包:
flatpak install flathub io.github.OpenToonz
这花了一点时间,但现在我拥有了 Blender、OpenToonz 和 Krita,它们都在正确更新的系统上运行。
一个主要的区别是,我使用 Flatpak 而不是 Snap 安装;我不确定 Snap 的问题是什么。