Red Hat Bugzilla – Bug 1016725
Empty /var/lib/alternatives/xxxx file makes `alternatives` confused
Last modified: 2016-07-19 06:27:57 EDT
Description of problem:
For some reason (VM crash during yum update probably) some of the files on my filesystem got corrupted. Haven't really checked why, it's a development VM. However, my java stopped working, realizing that /usr/bin/java was a broken symlink, pointing to /etc/alternatives/java which itself was a broken link.
Reinstalling a package that uses that alternative didn't help. From user point of view I was screwed.
Looking at the package scriptlet, it calls `alternatives --install ...` to install its newly installed commands. However that call always returns "/var/lib/alternatives/xxxx empty!" error messages, not doing anything useful.
Removing that corrupted file from /var/lib/alternatives/ made the above call successful, updating links in /etc/alternatives/ etc.
Such troubles may happen anytime and we should have a kind of disaster recovery to prevent user being stuck.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Corrupt some files in /var/lib/alternatives/, i.e. make them empty
2. Install package that uses alternatives, e.g. java-1.7.0-openjdk
3. Watch error messages below
Working alternative update
> alternatives --install /usr/bin/java java /usr/lib/jvm/java-1.7.0-openjdk-18.104.22.168-22.214.171.124.fc20.x86_64/jre/bin/java 170040
> alternatives --set $COMMAND /usr/lib/jvm/java-1.7.0-openjdk-126.96.36.199-188.8.131.52.fc20.x86_64/jre/bin/java
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.
More information and reason for this action is here:
Yeah, I encountered this problem on my F22 laptop after some heat issues resulted in a mid-dnf-update hard poweroff. Removing the empty /var/lib/alternatives/ entry fixed up the problem for me too!
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.