apt-get 损坏 - 现在无法安装或迁移任何东西

apt-get 损坏 - 现在无法安装或迁移任何东西

背景:运行 kubuntu 14.04,使用 kdm。我有一台 Brother MFC7280N,并安装了 brscan2 包。尽管如此,我还是无法扫描,因为找不到设备。我删除了(我认为)brscan2,希望重新安装。

我安装了 Kompozer,但当它开始显示奇怪的视频时,我不得不将其删除。我尝试重新安装它,但没有成功。我没有编辑任何配置文件,除了为 Kompozer 添加存储库(失败),或者除了运行 apt-get 和软件中心之外做任何事情。也就是说,我没有尝试任何(对我来说)奇怪的命令来安装、删除或修改已安装的软件。

我确实尝试从 .deb 文件和两个 tarball 安装 Kompozer。

现在我无法使用 apt-get 或 Ubuntu 软件中心安装或删除任何软件。以下是示例:

root@LEX:/home/bill# apt-get remove brscan2
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:
 kompozer:i386 : Depends: libatk1.0-0:i386 (>= 1.9.0) but it is not going to be installed
                 Depends: libcairo2:i386 (>= 1.0.2-2) but it is not going to be installed
                 Depends: libgtk2.0-0:i386 (>= 2.8.0) but it is not going to be installed
                 Depends: libidl0:i386 but it is not going to be installed
                 Depends: libpango1.0-0:i386 (>= 1.12.3) but it is not going to be installed
                 Depends: libxft2:i386 (> 2.1.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

这太奇怪了,我不知道该怎么回事。所以我需要一些专家的指导。

答案1

看来您安装的 deb 文件需要与 Ubuntu 14.04 的库不兼容的库。您只需卸载已安装的库即可。

sudo apt-get purge kompozer:i386

答案2

我刚刚遇到了这件事。

我认为问题有两个方面:

  1. Brother 的.debLinux 软件包打包得(从来都)不好,而且
  2. 二进制文件与 Ubuntu 14.04 不兼容。

以下是这个不会消失的包裹的整个场景:

user@sys:~$ sudo apt-get purge brscan2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  brscan2:i386
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 214320 files and directories currently installed.)
Removing brscan2 (0.2.5-1) ...
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/ALL’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData/AL’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/GrayCmData’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane/models2’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother/sane’: No such file or directory
rmdir: failed to remove ‘/usr/local/Brother’: No such file or directory
dpkg: error processing package brscan2 (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 brscan2
E: Sub-process /usr/bin/dpkg returned an error code (1)
user@sys:~$

您会看到,无法完全删除该包,因为删除该包所需执行的代码挂在某些丢失的目录中。

这是一个对我有用的解决方法:我创建了丢失的目录,并成功清除了包。

user@sys:~$ sudo mkdir -p /usr/local/Brother/sane/GrayCmData/
user@sys:~$ sudo mkdir -p /usr/local/Brother/sane/GrayCmData/ALL
user@sys:~$ sudo mkdir -p /usr/local/Brother/sane/GrayCmData/AL
user@sys:~$ sudo mkdir -p /usr/local/Brother/sane/models2

在我创建目录之后...

user@sys:~$ sudo apt-get purge brscan2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  brscan2:i386
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 214320 files and directories currently installed.)
Removing brscan2 (0.2.5-1) ...
user@sys:~$

软件清除成功。不用说,我现在要使用另一台扫描仪了。

我希望这个技巧能对某人有所帮助!

相关内容