how to update /etc/alternatives

Dave Korn dave.korn.cygwin@googlemail.com
Wed Mar 4 02:22:00 GMT 2009


[ Reply sent back to list.  http://cygwin.com/acronyms/#PPIOSPE, don't you
think Lester would have liked to be kept in the loop on this one if there's
any more useful information to be had? ]

Werner Wothke wrote:

>> Lester Ingber wrote:
>>
>>> I just manually changed the gcc and g++ under /etc/alternatives to point
>>> to v4, [ ... ]

> ...which I also did (Oops!) a few months ago to confiure gcc-4 as the
> only C++ compiler called by Eclipse-CDT under cygwin 1.5. Apparently, I
> will now have to do a complete reinstall of everything when cygwin 1.7
> comes out with gcc defaulting to version 4. I am not looking forward to
> that day, but I trust that the update can be made to work eventually. In
> the meantime, I am a happy weekend developer using *gcc* 4.3.2.

  The problem is that I have no idea how alternatives will behave in the
presence of symlinks in /etc/alternatives that don't point where its internal
record-keeping in /var/lib/alternatives say they should be pointing.  It may
reject the postinstall scripts that add the gcc-4 selections.  It may not, I
have no idea.

  There is a possibility you would be able to restore everything to a valid
state by running a command like

for x in g++ g77 gcc gcj gdc gnat gpc ;
do
  /usr/sbin/alternatives --auto $x ;
done

but again, I don't know if it'll be happy to allow that or not, if it notices
that the symlinks currently point to files it knows nothing about.  Note that
I have not tested nor reproduced any of this and am not going to; I don't want
to spend significant amounts of my time fixing other people's (what amounts
to) random misguided vandalism that they have committed against their own
computers, because it is not my fault and not my problem.  The best advice I
can give you is "just undo whatever it was you did".  If you do that before
attempting to install the next release of GCC-4, you'll be ok.

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list