Bug 1016725 - Empty /var/lib/alternatives/xxxx file makes `alternatives` confused
Empty /var/lib/alternatives/xxxx file makes `alternatives` confused
Product: Fedora
Classification: Fedora
Component: chkconfig (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukáš Nykrýn
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-10-08 11:08 EDT by Tomáš Bžatek
Modified: 2016-07-19 06:27 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-19 06:27:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tomáš Bžatek 2013-10-08 11:08:53 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):

How reproducible:

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

Actual results:
/var/lib/alternatives/java empty!
/var/lib/alternatives/jre_openjdk empty!
/var/lib/alternatives/jre_1.7.0 empty!

Expected results:
Working alternative update

Additional info:

Scriptlet excerpt:
> alternatives --install /usr/bin/java java /usr/lib/jvm/java-1.7.0-openjdk- 170040
> alternatives --set $COMMAND /usr/lib/jvm/java-1.7.0-openjdk-
Comment 1 Jaroslav Reznik 2015-03-03 10:07:30 EST
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:
Comment 4 CJ Kucera 2015-09-16 00:50:09 EDT
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!
Comment 5 Fedora End Of Life 2016-07-19 06:27:57 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.