Afer upgrading to emacs-22.1.50-1.fc9, /etc/alternatives/emacs points at /usr/bin/emacs-22.1, which doesn't exist. It should point at /usr/bin/emacs-22.1.50, I think.
This is bizarre, as both the F-8 and devel versions of the Emacs spec files properly call alternatives in %preun and %posttrans. Might it be a path problem? It's calling alternatives without /usr/sbin, and I'm not sure it's in the path (on the other hand, I did not notice any error when upgrading)
Usually the problem is that the /usr/bin/emacs file/link already exists, because it isn't properly removed by the scriptlet in the *old* package during the upgrade process. /sbin/alternatives won't overwrite it. The scriptlet ordering is a bit non-intuitive (to my mind). See http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#head-e54edd34de98841f72f542ebb78ae8e73860acca for details, but basically, because the %postun of the old package runs *after* the %post of the new package during an upgrade, if the %postun of the old package removes the old link, it will happen *after* the %post of the new package has tried to install it. That's why I moved it all to %posttrans. What should work is removing the old package and then installing the new one (i.e. do the upgrade in two steps). Chip
$ sudo yum -y remove emacs [...] $ sudo yum -y install emacs [...] $ which emacs /usr/bin/which: no emacs in (/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/home/misc/bin) $ cd /usr/bin $ ll emacs lrwxrwxrwx 1 root root 23 2007-06-28 10:26 emacs -> /etc/alternatives/emacs $ rpm -q emacs emacs-22.1.50-3.fc9
What does the /etc/alternatives/emacs symlink point to? Chip
/etc/alternatives/emacs -> /usr/bin/emacs-22.1 which doesn't exist. Only /usr/bin/emacs-22.1.50 exists.
So the problem is that the old package didn't properly remove the symlink; thus when the new package was installed, alternatives didn't overwrite it. Try this: remove emacs. Manually remove the two (broken) symlinks /usr/bin/emacs and /etc/alternatives/emacs. install emacs. And let me know if the symlink is there and working. Chip
Negative. # rm -f /etc/alternatives/emacs /usr/bin/emacs # yum -y remove emacs [...] # yum -y install emacs [...] Transaction Test Succeeded Running Transaction Installing: emacs ######################### [1/1] failed to read link /usr/bin/emacs: No such file or directory [...] # which emacs /usr/bin/which: no emacs in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) # ll /usr/bin/emacs* lrwxrwxrwx 1 root root 23 2008-01-29 20:45 /usr/bin/emacs -> /etc/alternatives/emacs -rwxr-xr-t 1 root root 5563696 2007-12-13 19:58 /usr/bin/emacs-22.1.50 -rwxr-xr-x 1 root root 18660 2007-12-13 19:59 /usr/bin/emacsclient # ll /etc/alternatives/emacs lrwxrwxrwx 1 root root 19 2008-01-29 20:45 /etc/alternatives/emacs -> /usr/bin/emacs-22.1
In rawhide, the emacs link is now completely gone. emacs-22.1.50-4.fc9.x86_64
*** Bug 437599 has been marked as a duplicate of this bug. ***
This still is a problem. I upgraded what was a previously up-to-date rawhide system with emacs-22.1.50-4.fc9, to the new rawhide emacs-23.0.60-2.fc9. The /usr/bin/emacs symlink points to /etc/alternatives/emacs. /etc/alternatives/emacs still pointed pointed to the now removed older package. # 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-23.0.60 - priority 80 Current `best' version is /usr/bin/emacs-22.1. Of course, this breaks any system where emacs was working properly before. Users must manually run: # alternatives --set emacs /usr/bin/emacs-23.0.60 to restore emacs to working. This isn't good behavior.
*** Bug 439076 has been marked as a duplicate of this bug. ***
Moving this to F9Blocker since bug 439076 was on the blocker list. Is it actually possible to fix this for people upgrading from F8?
Still a problem with 22.2-1.fc9. I removed emacs, removed /etc/alternatives/emacs. After then installing emacs-22.2-1.fc9, I now have a fresh dead /etc/alternatives/emacs symlink: # ll /etc/alternatives/emacs lrwxrwxrwx 1 root root 19 2008-04-30 11:50 /etc/alternatives/emacs -> /usr/bin/emacs-22.1
Can someone reproduce this with 22.2-4.fc9?
On my F9-preview box I yum erased emacs, installed emacs-22.1-8.fc8 and then upgraded to emacs-22.2-4.fc9 using rpm -Uvh. It's still affected: [root@brad ~]# 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.2 - priority 80 Current `best' version is /usr/bin/emacs-22.1.
And in the situation I described in comment #13, 22.2-4.fc9 behaves exactly the same.
This is a problem with the F-8 (or similar) packages that have: %preun if [ $1 -eq 0 ] ; then alternatives --remove emacs %{_bindir}/emacs-%{version} fi The current latest update for F-8 (22.1-8.fc8) has this problem. This can't be fixed in F-9 - we need to push a newer build for F-8 that removes the conditional from the %preun. These fixes appear to already be in CVS, so we just need to build and push an update.
As it's not a F-9 fix, removing from the F9 Blocker.
Per the scenario I described, there would appear to be something still malfunctioning irrespective of F-8.
I did a clean install of 22.1-8.fc8 on F9-preview with rpm, upgraded to 22.1-11.fc8 with rpm, and then yum upgraded to 22.2-4.fc9. The 22.2 package updated the alternatives as it should.
Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
If this bug is just about upgrading (as the summary suggests), then perhaps it's fixed. I've created bug 446467 to cover the problem I'm observing.
*** This bug has been marked as a duplicate of bug 474578 ***