apt-get 升级失败:“guvcview:依赖:libguvcview-2.0-0 但未安装”

bee*_*bee 6 upgrade apt

编辑:我的问题是重复的,但我在这里的答案与上面链接的重复中的答案略有不同。

由于此错误,我无法使用 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.
Run Code Online (Sandbox Code Playgroud)

我确定我可以找到并修复此错误。我更想知道为什么整个 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.
Run Code Online (Sandbox Code Playgroud)

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)
Run Code Online (Sandbox Code Playgroud)

应该注意的是,该文件/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).
Run Code Online (Sandbox Code Playgroud)

操作系统:Lubuntu 桌面(Ubuntu 16.10)

bee*_*bee 8

我在这里找到了答案:

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]
Run Code Online (Sandbox Code Playgroud)

根据上面的答案,我曾经dkpg -r --force-depends删除它们:

sudo dpkg -r --force-depends guvcview
sudo dpkg -r --force-depends libguvcview-2.0-2
Run Code Online (Sandbox Code Playgroud)

那时我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.
Run Code Online (Sandbox Code Playgroud)

啊哈!这次我收到了预期的错误消息。guvcview是一个lubuntu-desktop依赖于的包:这意味着如果我在删除后重新安装它,一切都应该恢复正常,对吗?

运行这些命令后:

sudo apt-get -f install
sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)

现在一切正常。guvcview也在再次工作,这很好,因为我在调试此错误时破坏了它。

欢迎回来