apt-get install -f 保存的软件包

apt-get install -f 保存的软件包

我在升级 Ubuntu 系统中的软件包时遇到了问题。我按照问题中的解决方案进行操作这里通过使用它,我能够dpkg --configure -a通过从文件中删除损坏的包来解决我在执行过程中遇到的错误,/var/lib/dpkg/status但现在执行完后apt-get install -f我收到以下错误。请帮忙。

我不知道,因为从文件中删除下面的包会导致我的系统出现任何问题。

apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
  apparmor: Depends: initramfs-tools but it is not installed
  brltty: Depends: initramfs-tools (>= 0.40ubuntu30) but it is not installed
  console-setup: Depends: initramfs-tools (>= 0.85eubuntu12) but it is not installed
  dmsetup: Depends: initramfs-tools but it is not installed
  kbd: Depends: initramfs-tools but it is not installed
  linux-image-2.6.32-38-generic: Depends: initramfs-tools (>= 0.36ubuntu6) but it is not installed
  ntfs-3g: Depends: initramfs-tools but it is not installed
  plymouth: Depends: initramfs-tools but it is not installed
  udev: Depends: initramfs-tools (>= 0.92bubuntu63) but it is not installed
  watershed: Depends: initramfs-tools but it is not installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

编辑1

apt-get --reinstall install initramfs-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  initramfs-tools
0 upgraded, 1 newly installed, 0 to remove and 921 not upgraded.
1 not fully installed or removed.
Need to get 49.0kB of archives.
After this operation, 372kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ precise-updates/main initramfs-tools 0.99ubuntu13.1 [49.0kB]
Fetched 49.0kB in 9s (5,302B/s)                                                                                                                             
Selecting previously deselected package initramfs-tools.
(Reading database ... 140222 files and directories currently installed.)
Unpacking initramfs-tools (from .../initramfs-tools_0.99ubuntu13.1_all.deb) ...
Processing triggers for doc-base ...
Processing 1 changed doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for man-db ...
Setting up initramfs-tools (0.99ubuntu13.1) ...
cp: not writing through dangling symlink `/etc/initramfs-tools/modules'
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of watershed:
 watershed depends on initramfs-tools; however:
  Package initramfs-tools is not configured yet.
dpkg: error processing watershed (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 initramfs-tools
 watershed
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

该问题是由于符号链接引起的,因此我使用以下命令创建了一个符号链接

ln -sf /etc/initramfs-tools/modules.AfterVMwareToolsInstall /etc/initramfs-tools/modules

然后

mv /etc/initramfs-tools/modules{,BAK}; sudo touch /etc/initramfs-tools/modules

然后

dpkg --configure -a 

apt-get -f install

这是一个与 VMware 模块相关的问题。

再次感谢 fossfreedom 和 Oli

相关内容