Title: apt-get install -f held packages
Tags: installation;apt;package-management;dpkg
Question: I am having trouble upgrading the packages in my Ubuntu system. I followed the solution in the question here by using it I was able to troubleshoot the error I was encountering while doing dpkg --configure -a by removing the broken packages from the file in /var/lib/dpkg/status but now after doing apt-get install -f I get the following error. Please Help.
I dont know because will removing the below packages from the file will cause any problem in my system.
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 (&gt;= 0.40ubuntu30) but it is not installed
console-setup: Depends: initramfs-tools (&gt;= 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 (&gt;= 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 (&gt;= 0.92bubuntu63) but it is not installed
watershed: Depends: initramfs-tools but it is not installed
E: Error, pkgProblemResolver75b5:f2c1:f5d7:b954:8dc3:cee9:baf:a8c0Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
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)
Comment: This is strange: `cp: not writing through dangling symlink "/etc/initramfs-tools/modules"` -- in my install /etc and /etc/initramfs-tools are directories and modules is a file. No symbolic links josephbowen@example.org...

Comment: Ya. I was able to sort out my problem now with the help of fossfreedom and Oli it was a problem of dangling symlinks.

Here is the accepted answer: The problem was caused due to symlink so I created one using the command
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
It was a problem related to VMware module.
Thanks again to fossfreedom and Oli


{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:08/30/13', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<installation><apt><package-management><dpkg>', 'Title': 'apt-get install -f held packages', 'ViewCount': 3181, 'id': 339240, 'user_AboutMe': '', 'user_AccountId': 2892510.0, 'user_DisplayName': 'Tarun', 'user_Reputation': 4167.0, 'user_Views': 522.0, 'user_id': 166815.0}}