编辑:我的问题是重复的,但我在这里的答案与上面链接的重复中的答案略有不同。
由于此错误,我无法使用 APT 安装、删除或升级任何内容:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
guvcview : Depends: libguvcview-2.0-0 but it is not installed
Recommends: uvcdynctrl but it is not installed
E: Unmet dependencies. Try using -f.
我确信我能找到并修复这个错误。我更想知道为什么整个 apt 都因为一个程序出现问题而崩溃。
编辑:我也不能apt-get dist-upgrade
:
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
guvcview : Depends: libguvcview-2.0-0 but it is not installed
Recommends: uvcdynctrl but it is not installed
E: Unmet dependencies. Try using -f.
apt-get -f install
遇到此错误:
Preparing to unpack .../libguvcview-2.0-0_2.0.5+ubuntu2~ppa1+1418-0ubuntu1~201702081552~ubuntu16.10.1_amd64.deb ...
Unpacking libguvcview-2.0-0:amd64 (2.0.5+ubuntu2~ppa1+1418-0ubuntu1~201702081552~ubuntu16.10.1) ...
dpkg: error processing archive /var/cache/apt/archives/libguvcview-2.0-0_2.0.5+ubuntu2~ppa1+1418-0ubuntu1~201702081552~ubuntu16.10.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libgviewaudio-2.0.so.2.0.0', which is also in package libguvcview-2.0-2:amd64 2.0.4+debian-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libguvcview-2.0-0_2.0.5+ubuntu2~ppa1+1418-0ubuntu1~201702081552~ubuntu16.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
需要注意的是,该文件/usr/lib/x86_64-linux-gnu/libgviewaudio-2.0.so.2.0.0
在我的系统中不存在。
因此,我无法对 APT 做任何事情。我甚至无法删除不相关的程序。abiword
是一个文本编辑器。
$ sudo apt-get remove abiword
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
guvcview : Depends: libguvcview-2.0-0 but it is not going to be installed
Recommends: uvcdynctrl but it is not going to be installed
lubuntu-desktop : Depends: abiword but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
操作系统:Lubuntu 桌面(Ubuntu 16.10)
答案1
我在这里找到了答案:
apt-get 命令因 libpython3.3 未满足依赖项而失败
显然我安装了两个相互冲突的版本guvcview
。
apt list --installed | grep guvc
guvcview/yakkety,now 2.0.5+ubuntu2~ppa1+1418-0ubuntu1~201702081552~ubuntu16.10.1 amd64 [installed]
libguvcview-2.0-2/yakkety,now 2.0.4+debian-1 amd64 [installed]
根据上面的答案,我曾经dkpg -r --force-depends
删除它们:
sudo dpkg -r --force-depends guvcview
sudo dpkg -r --force-depends libguvcview-2.0-2
此时我apt-get upgrade
再次尝试正常操作:
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
lubuntu-desktop : Depends: guvcview but it is not installed
E: Unmet dependencies. Try using -f.
啊哈!这次我收到了预期的错误消息。guvcview
是一个依赖于的包lubuntu-desktop
:这意味着如果我在删除它之后重新安装它,一切都应该恢复正常,对吗?
运行这些命令后:
sudo apt-get -f install
sudo apt-get upgrade
现在一切正常。guvcview
也可以再次工作了,这很好,因为我在调试这个错误时把它弄坏了。