软件中心崩溃,apt-get install -f 出现问题

软件中心崩溃,apt-get install -f 出现问题

我的 ubuntu 14.04 软件中心崩溃了。有些消息来源说我必须这样做sudo apt-get purge software-center。但是,当我运行它时出现了一些错误,其中之一是

E:未满足依赖关系。尝试不使用任何软件包的“apt-get -f install”(或指定解决方案)。

所以我尝试这样做apt-get -f install。但结果是

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:
linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
hplip-data python-samba
The following packages will be upgraded:
hplip-data python-samba
2 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
7 not fully installed or removed.
Need to get 0 B/7.274 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 352449 files and directories currently installed.)
Preparing to unpack .../hplip-data_3.14.3-0ubuntu3.4_all.deb ...
Bus error (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 135
dpkg: trying script from the new package instead ...
Bus error (core dumped)
dpkg: error processing archive /var/cache/apt/archives/hplip-data_3.14.3-0ubuntu3.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 135
Bus error (core dumped)
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 135
Preparing to unpack .../python-samba_2%3a4.1.6+dfsg-1ubuntu2.14.04.8_amd64.deb ...
Bus error (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 135
dpkg: trying script from the new package instead ...
Bus error (core dumped)
dpkg: error processing archive /var/cache/apt/archives/python-samba_2%3a4.1.6+dfsg-1ubuntu2.14.04.8_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 135
Bus error (core dumped)
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 135
Errors were encountered while processing:
/var/cache/apt/archives/hplip-data_3.14.3-0ubuntu3.4_all.deb
/var/cache/apt/archives/python-samba_2%3a4.1.6+dfsg-1ubuntu2.14.04.8_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

那么我该怎么办?

答案1

清除有问题的软件包:

sudo apt-get purge hplip-data 
sudo apt-get purge python-samba

另外,通过以下方式查看一切是否正常:

sudo apt-get install -f

答案2

尝试使用以下命令检查 apt-get:

sudo apt-get check

它将检查依赖性问题并修复,如果问题仍然存在,请尝试手动编辑 dpkg 状态文件:

sudo gedit /var/lib/dpkg/status(如果你愿意的话,你可以使用 vi 或 nano)

找到损坏的包,并删除与其相关的整个块,并且不要忘记保存文件。

答案3

请尝试删除档案中的软件包

sudo rm -r /var/cache/apt/archives/*

是,我确定。;)

现在运行

sudo apt-get update
sudo apt-get dist-upgrade

并且怎么说,你应该删除software-center:\

请重新安装

sudo apt-get install --reinstall software-center

相关内容