安装了错误的 teamvierer 包现在我遇到了未满足的依赖问题,如何恢复?

安装了错误的 teamvierer 包现在我遇到了未满足的依赖问题,如何恢复?

错误尝试安装 TeamViewer 后,包管理中断(我从 TeamViewer 网站选择了错误的 TeamViewer 包)。

我努力了:

sudo apt-get clean
sudo apt-get update

那么如果我这样做:

sudo apt-get install -f

我得到:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  language-pack-kde-en kde-l10n-engb language-pack-kde-en-base
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libsane:i386
Suggested packages:
  hpoj:i386 hplip:i386 libsane-extras:i386 sane-utils:i386
The following NEW packages will be installed
  libsane:i386
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,554 kB of archives.
After this operation, 8,503 kB of additional disk space will be used.
Do you want to continue [Y/n]? 
(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb (--unpack):
 './lib/udev/rules.d/40-libsane.rules' is different from the same file on the system
Errors were encountered while processing:
 /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

删除问题包似乎不起作用:

sudo apt-get remove libsane:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libsane:i386 is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 ia32-libs-multiarch:i386 : Depends: libsane:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

删除 ia32-libs-multiarch:i386 也不起作用:

sudo apt-get remove ia32-libs-multiarch:i386
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.
 ia32-libs : Depends: ia32-libs-multiarch
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Ubuntu 软件中心现在无法使用,因为它不断给我一个错误对话框说“在修复软件包目录之前,无法安装或删除项目。您想现在修复它吗?” - 但是修复失败,如下所示:

(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb (--unpack):
 './lib/udev/rules.d/40-libsane.rules' is different from the same file on the system
Errors were encountered while processing:
 /var/cache/apt/archives/libsane_1.0.22-7ubuntu1_i386.deb
Error in function: 
dpkg: dependency problems prevent configuration of ia32-libs-multiarch:i386:
 ia32-libs-multiarch:i386 depends on libsane; however:
  Package libsane:i386 is not installed.
dpkg: error processing ia32-libs-multiarch:i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ia32-libs:
 ia32-libs depends on ia32-libs-multiarch; however:
  Package ia32-libs-multiarch is not installed.
  Package ia32-libs-multiarch:i386 is not configured yet.
dpkg: error processing ia32-libs (--configure):
 dependency problems - leaving unconfigured

我还收到一条通知,提示“发生错误,请从右键菜单运行包管理器或在终端中运行 apt-get 查看错误所在。错误消息为:‘错误:BrokenCount > 0’。这通常意味着您安装的软件包有未满足的依赖关系”。

有什么建议可以帮你摆脱这种困境吗?非常感谢。

答案1

我终于解决了这个问题。存在循环依赖关系:ia32-libs-multiarch:i386 依赖于 libsane:i386,反之亦然。apt-get 拒绝删除其中一个,因为它依赖于另一个。此外,如果您在同一命令行上同时指定两者,它也会拒绝删除它们。例如:

sudo apt-get remove libsane:i386 ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libsane:i386 is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 ia32-libs : Depends: ia32-libs-multiarch
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

然而它将要如果您在同一个命令行上指定它们,则允许您安装它们:

sudo apt-get install libsane:i386 ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ia32-libs-multiarch:i386 is already the newest version.
The following packages were automatically installed and are no longer required:
  language-pack-kde-en kde-l10n-engb language-pack-kde-en-base
Use 'apt-get autoremove' to remove them.
Suggested packages:
  hpoj:i386 hplip:i386 libsane-extras:i386 sane-utils:i386
The following NEW packages will be installed
  libsane:i386
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,554 kB of archives.
After this operation, 8,503 kB of additional disk space will be used.
Do you want to continue [Y/n]? 
(Reading database ... 479536 files and directories currently installed.)
Unpacking libsane:i386 (from .../libsane_1.0.22-7ubuntu1_i386.deb) ...
Setting up libsane:i386 (1.0.22-7ubuntu1) ...
Setting up ia32-libs-multiarch:i386 (20090808ubuntu36) ...
Setting up ia32-libs (20090808ubuntu36) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

之后一切恢复正常,我可以再次删除 ia32-libs-multiarch:i386。

答案2

好的,让我们逐一修复您的错误:

  • 删除 teamviewer 及依赖项:

    sudo apt-get --purge autoremove teamviewer*
    
  • 删除任何ia32-libs包:

    sudo apt-get --purge autoremove ia32-libs*
    
  • 我相信你有一个 64 位系统,因此libsane必须使用 32 位:

    sudo apt-get --purge autoremove libsane:i386
    
  • 修复任何其他问题:

    sudo apt-get update
    sudo apt-get -f install
    
  • 验证一切是否正确:

    sudo apt-get check
    

    如果在最后一步您发现的问题与您现在面临的问题不同,请提出另一个问题。

相关内容