Description of problem: Upgrading emacs between different versions doesn't properly unregister the old symlinks provided through alternatives. This results in a broken /usr/bin/emacs symlink and .desktop files. Version-Release number of selected component (if applicable): 22.1-8.fc8 to 22.1.50-4.fc0 How reproducible: Everytime Steps to Reproduce: root@gibson ~]# yum list installed 'emacs*' Error: No matching Packages to list [root@gibson ~]# alternatives --display emacs [root@gibson ~]# yum install emacs emacs-{common,nox,el} -y %%%%%%%%%%%%%%%% yum output omitted for brevity %%%%%%%%%%%%%%%%%%%% [root@gibson ~]# yum list installed 'emacs*' Installed Packages emacs.i386 22.1-8.fc8 installed emacs-common.i386 22.1-8.fc8 installed emacs-el.i386 22.1-8.fc8 installed emacs-nox.i386 22.1-8.fc8 installed [root@gibson ~]# alternatives --display emacs emacs - status is auto. link currently points to /usr/bin/emacs-22.1 /usr/bin/emacs-22.1 - priority 80 /usr/bin/emacs-22.1-nox - priority 70 Current `best' version is /usr/bin/emacs-22.1. [root@gibson ~]# yum upgrade 'emacs*' -y --enablerepo=development %%%%%%%%%%%%%%%% yum output omitted for brevity %%%%%%%%%%%%%%%%%%%% [root@gibson ~]# yum list installed 'emacs*' Installed Packages emacs.i386 22.1.50-4.fc9 installed emacs-common.i386 22.1.50-4.fc9 installed emacs-el.i386 22.1.50-4.fc9 installed emacs-nox.i386 22.1.50-4.fc9 installed Actual results: [root@gibson ~]# alternatives --display emacs emacs - status is auto. link currently points to /usr/bin/emacs-22.1 /usr/bin/emacs-22.1 - priority 80 /usr/bin/emacs-22.1-nox - priority 70 /usr/bin/emacs-22.1.50-nox - priority 70 /usr/bin/emacs-22.1.50 - priority 80 Current `best' version is /usr/bin/emacs-22.1. [root@gibson ~]# emacs -bash: emacs: command not found Expected results: [root@gibson ~]# alternatives --display emacs emacs - status is auto. link currently points to /usr/bin/emacs-22.1.50 /usr/bin/emacs-22.1.50 - priority 80 /usr/bin/emacs-22.1.50-nox - priority 70 Current `best' version is /usr/bin/emacs-22.1.50. Additional info: FWIW, I have the same problem on a different machine running x86_64 rawhide upgrading from 22.1.50-4.fc9 to 23.0.60 packages. The spec for 23.0.60 has merged in all recent changes in rawhide, including the %pre/%post scriptlet `alternatives' changes.
I just saw this too after upgrading my laptop from F8 to current pre-F9. Maybe %posttrans is not getting run? It would be very good to fix this before the final release.
Hmm actually even running the %posttrans script by hand did not fix the problem for me.
The same issue hit when replacing on rawhide emacs-22.1.50-4.fc9 with an updated emacs-23.0.60-2.fc9. After the last version showed up 'alternatives --display emacs' prints: emacs - status is manual. link currently points to /usr/bin/emacs-22.1.50 /usr/bin/emacs-21.3 - priority 50 /usr/bin/emacs-22.1 - priority 80 /usr/bin/emacs-23.0.60 - priority 80 Current `best' version is /usr/bin/emacs-22.1. and running a command from package scripts with --verbose, i.e. alternatives --verbose --install /usr/bin/emacs emacs /usr/bin/emacs-23.0.60 80 results in: reading /var/lib/alternatives/emacs That is what I have now in /var/lib/alternatives/emacs manual /usr/bin/emacs /usr/bin/emacs-21.3 50 /usr/bin/emacs-22.1 80 /usr/bin/emacs-23.0.60 80 It appears that every alternatives operation I am trying ends up with "link points to no alternative -- setting mode to manual" and no action. Should have been old link removed in %preun? That may be too late for yum.
Urhg! The above "results in:" should be followed by reading /var/lib/alternatives/emacs link points to no alternative -- setting mode to manual
Michael, what if you uninstall emacs and then try upgrading from one fc9 version to another? I've only been able to reproduce this problem when upgrading from the fc8 packages to fc9. Upgrading from 22.1.50-fc9 to 22.2-fc9 or 23.0.60-fc9 on a fresh install doesn't cause problems for me.
> ... try upgrading from one fc9 version to another? As I said in a comment #3 what got me was an update from emacs-22.1.50-4.fc9 to emacs-23.0.60-2.fc9; all withing rawhide. I did not have any fc8 emacs packages on that particular installation for a long time. /var/lib/alternatives/emacs may had some very old lefovers in it but so what? I am aware that eventually I am able to work around that trouble one way or another.
I think the issue is simply related to the change of version. Going from f8 (22.1) to f9 (22.2) leaves two alternatives for emacs at priority 80: /usr/bin/emacs-22.1 and /usr/bin/emacs-22.2, and /usr/bin/emacs-22.1 gets chosen since it is first, leaving a dangling symlink. But if emacs-22.1 has to remove itself properly there may not be a clean way to fix this without a hack?
This is probably a duplicate of bug #394131
> I think the issue is simply related to the change of version. Reverting emacs-23 packages to emacs-22.2-1.fc9 (see "20080424 changes") updated alternatives correctly. Possibly because I did that with 'rpm -U --oldpackage ...' and not with yum going through two stages.
*** This bug has been marked as a duplicate of 394131 ***