无法添加或删除软件包;处理时遇到错误:libbz2-1.0 libbz2-1.0:i386

无法添加或删除软件包;处理时遇到错误:libbz2-1.0 libbz2-1.0:i386

我注意到 Ubuntu 已经有一段时间没有要求我更新了,这很奇怪。因此,我打开了更新管理器并收到了一条消息,

Software index is broken

It is impossible to install or remove any software. Please use the package manager
"Synaptic" or run "sudo apt-get install -f" in a terminal to fix this issue at first.

因此,我启动了终端会话并输入“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:
  libatk1.0-0:i386 libffmpegthumbnailer4 efibootmgr eom-common
  libxcb-dri2-0 linux-headers-3.2.0-45 mate-media-common
  beat-hazard-ultra-bin:i386 mate-screensaver-common ffmpegthumbnailer
  python-gtksourceview2 libcairo2:i386 pidgin-data
  linux-headers-3.2.0-45-generic libgdk-pixbuf2.0-0:i386 pluma-common
  libpixman-1-0:i386 libmatewnck-common pluma libxft2:i386
  libxrandr-ltsq2 linux-headers-3.5.0-23-generic language-pack-kde-en
  linux-headers-3.5.0-23 kde-l10n-engb libjasper1:i386
  gtk2-engines-pixbuf indicator-status-provider-pidgin
  libgtksourceview2.0-0 libpango1.0-0:i386 libmatewnck
  libxcb-render0:i386 mate-utils-common libgxps2 libxcb-shm0:i386
  language-pack-kde-en-base libgtk2.0-0:i386 libgtksourceview2.0-common
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  libbz2-1.0:i386
0 upgraded, 0 newly installed, 1 to remove and 11 not upgraded.
2 not fully installed or removed.
After this operation, 115 kB disk space will be freed.
Do you want to continue [Y/n]? y
E: Internal Error, No file name for libbz2-1.0

我认为问题出在我尝试手动安装 libbz2-1.0 时,不小心使用了 i386 二进制文件而不是 amd64 二进制文件。有人能帮我修复这个问题吗?在修复之前我无法安装或删除任何东西,而且真的不想重新安装。非常感谢您能给我的任何帮助。

答案1

没关系。我已经想出了如何自己修复它的方法。对于遇到此问题的其他任何人,您需要执行以下操作:

  1. 输入sudo dpkg --configure -a。它会出错,但不用担心。
  2. 找到导致问题的文件并键入sudo dpkg -r PACKAGE_NAME每个文件以将其删除。有些文件将无法删除。将它们添加到列表中。
  3. sudo dpkg --configure PACKAGE_NAME对列表中的每个包运行。它将配置它们。这次,你不应该看到任何错误。
  4. 运行sudo apt-get install -f以修复依赖关系。
  5. 利润!

相关内容