Mailing List Archive

Portage Arrrhhhh!...
Hi All,

Well, with a few simple keystrokes I've managed to nuke Portage. It went something like this...

1. emerge sync -> OK
2. emerge Portage -> Portage 2.0.51_rc9 OK
3. emerge do anything else -> NOT OK!!!

Here's an error message after (most) emerge attempts:

>>> file mode: r+ open: No such file or directory
>>> pids file write: Illegal seek

I did some searching and it may be a bug with Portage and GCC...

* sys-devel/gcc
Latest version available: 3.4.2-r2
Latest version installed: 2.95.3-r8

That's right folks, there is no ebuild for 3.4.2-r2 in the tree! Yes, I was (finally) getting around to upgrading GCC.

Of course, now with a broken emerge I can't just upgrade Portage when the next release is available.

Please help, thanks!

--

|<eppy

--
gentoo-user@gentoo.org mailing list
Re: Portage Arrrhhhh!... [ In reply to ]
On Tue, 19 Oct 2004, Keppy wrote:

> * sys-devel/gcc
> Latest version available: 3.4.2-r2
> Latest version installed: 2.95.3-r8

Sorry, I don't have the answer to your question but how is it possible,
that you *still* have only gcc 2.95 installed.

I just have to ask this - the default stable compiler has been 3.x for a
very, very long time now...

--
T.G.

--
gentoo-user@gentoo.org mailing list
Re: Portage Arrrhhhh!... [ In reply to ]
Keppy kirjoitti viestissään (lähetysaika tiistai, 19. lokakuuta 2004 15:36):
> Of course, now with a broken emerge I can't just upgrade Portage when the
> next release is available.
>
> Please help, thanks!

1: less ${PORTDIR}/sys-apps/portage/files/README.RESCUE
2: Act accordingly
3: Update to gcc 3.*
4: Upgrade portage

--
Jani-Matti Hätinen

--
gentoo-user@gentoo.org mailing list
Re: Portage Arrrhhhh!... [ In reply to ]
On Tuesday 19 October 2004 09:03 am, Tero Grundström wrote:

> Sorry, I don't have the answer to your question but how is it possible,
> that you *still* have only gcc 2.95 installed.
>
> I just have to ask this - the default stable compiler has been 3.x for a
> very, very long time now...

Most of my machines have it (if not all).. Older installations.. ;) Thats
really the answer..

Jeff
Re: Portage Arrrhhhh!... [ In reply to ]
Hi all,

Thanks for your sympathy and suggestions ;-) I'm now back in business... live
and learn I guess....


|<eppy

-

>> How to upgrade GCC 2.95.3-r8 to 3.4.2 with a borked Portage <<


DISCLAIMER
This document is a how-to of sorts that I wrote as a result of having to dig
myself out of a GCC black hole. It describes the steps I, I repeat, I took to
upgrade from GCC 2.95.3-r8 to GCC 3.4.2-r2 with a little bit of assistance from
Portage. I wrote this in good faith that it may save some poor soul the trauma
of bootstrapping or re-installing Gentoo out of sheer frustration. That said,
I do not claim that this how-to is the shortest, easiest, longest, silliest,
or most technically correct way of achieving the task, but it did work for me! Of course, YMMV so don't come crying back to me if things go even further South
after following the steps in this guide. And in case you were wondering I did
Google and post to gentoo-user for a possible solution but only ended up
finding the problem and part of the solution. If anyone has anything to add to
this guide please do so, that would be good.

THE PROBLEM
Like most people stuck on a dial-up Internet connection I yearn for the day
when I can update my Gentoo box in a matter of minutes rather than a matter of
hours. But I don't have broadband. Having let my box go without upgrading GCC
in a (very) long while, I decided to take the plunge and go from the last of
the version 2.xx.x GCCs in Portage to at least version 3.4.x. Little did I
know that there is a bug in Portage versions ~ 2.0.50 that make it commit
suicide with GCC 2.95.3-r8. The error messages when you try to use emerge look
something like this:

>>> file mode: r+ open: No such file or directory
>>> pids file write: Illegal seek

I have a feeling this is the feature:

http://bugs.gentoo.org/show_bug.cgi?id=64339

Was this ever broadcast to the users? Anywho, with a borked Portage I
immediately hit the panic button and called out to gentoo-users for help.
After a few "duh, you still have GCC 2.95.3?" posts, Gentoo user Jani-Matti
H?tinen suggested I go down the rescue path:

1: less ${PORTDIR}/sys-apps/portage/files/README.RESCUE
2: Act accordingly
3: Update to gcc 3.*
4: Upgrade portage

So I grap the Portage rescue tarball:

# wget http://dev.gentoo.org/~carpaski/portage_rescue/portage-rescue-2.0.50-r1-x86.tbz2

and

# tar xjpUvf portage-rescue-2.0.50-r1-x86.tbz2 -C /

This got Portage back on track so I immediately set about upgrading GCC.
Everying went smoothly - NOT! I couldn't upgrade GCC because I still had
glibc-2.2.5-r2 installed and I couldn't upgrade glibc as at least version 3.2
of GCC is required. Ahhh... the joys of a vicious circle ;-) Attempting to
upgrade 3.2 and 3.3 versions also failed. The only thing that did install was libstdc++-v3 so I went ahead and installed it.

THE SOLUTION (HACK)

With GCC 3.4.2 downloaded in my disfiles I set about doing a vanilla install
with the familiar:

# ./configure
# make
# make install

This actually worked and installed GCC in the default places - fine for
remedial upgrades ;-). Now, I needed to get Portage to 'see' that GCC 3.4.2 is
available to get back on track and avoid ending up with the next version of
Slackware ;-). Inject GCC 3.4.2 so Portage 'thinks' it's installed:

# emerge -i sys-devel/gcc-3.4.2

Next, I rolled my own GCC config with:

# cp /etc/env.d/gcc/i686-pc-linux-gnu-2.95.3 /etc/env.d/gcc/i686-pc-linux-gnu-3.4.2
# vi /etc/env.d/gcc/i686-pc-linux-gnu-3.4.2

and change the old settings:
PATH="/usr/i686-pc-linux-gnu/gcc-bin/2.95"
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/2.95"
LDPATH="/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.3"
MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/2.95/man"
INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/2.95/info"
STDCXX_INCDIR="g++"
CC="gcc"
CXX="g++"

to where me and the vanilla GCC put them:
PATH="/usr/i686-pc-linux-gnu/gcc-bin/3.4.2"
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/3.4.2"
LDPATH="/usr/local/lib"
MANPATH="/usr/man1"
INFOPATH="/usr/info"
STDCXX_INCDIR="g++"
CC="gcc"
CXX="g++"

NOTE: I created the first two directories and copied the binaries from
/usr/local/bin and for LDPATH I copied the contents of
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.2/ to /usr/local/lib. I have no idea
why it just seemed like a good idea at the time.

Now, with GCC "installed" and "merged", you need to select version 3.4.2. Do
this with gcc config.

# gcc-config i686-pc-linux-gnu-3.4.2

From memory GCC complained but accepted the change. I then went ahead and
attempted to merge glibc. Hey, presto! It worked! Next step? You guessed it -
merge GCC with Portage. With all that out of the way I then went ahead and
re-merged Portage back to where it was.

root@korner ~ # epm -q portage gcc glibc libstdc++-v3
portage-2.0.51
gcc-3.4.2-r2
gcc-2.95.3-r8
glibc-2.2.5-r2
glibc-2.3.4.20041006
libstdc++-v3-3.3.4

CONCLUSION
I've been a happy Gentoo user for over two and a half years now. Having come
from a background of legacy distributions like Red Hat and Debian I'll never go back. Gentoo presents all sorts of challenges - like the one you just read - that help you learn more about Linux. Having been through that I did learn one
Hell of a lesson - keep pace with its rapid pace of development to avoid
borkage. Now, on to X.org...

|<eppy <keppy@ar.com.au>

--
gentoo-user@gentoo.org mailing list
Re: Portage Arrrhhhh!... [ In reply to ]
On Mon, Oct 25, 2004 at 11:20:24PM +1000, Keppy wrote:
> CONCLUSION
> I've been a happy Gentoo user for over two and a half years now. Having come
> from a background of legacy distributions like Red Hat and Debian I'll never go back. Gentoo presents all sorts of challenges - like the one you just read - that help you learn more about Linux. Having been through that I did learn one
> Hell of a lesson - keep pace with its rapid pace of development to avoid
> borkage. Now, on to X.org...

I think that's the wrong lesson to take away from this episode. The
real lesson is to keep regular system backups, expecially before large
upgrades. :-)

- Chris


--
gentoo-user@gentoo.org mailing list
Re: Re: Portage Arrrhhhh!... [ In reply to ]
Chris Frey wrote:

> I think that's the wrong lesson to take away from this episode. The
> real lesson is to keep regular system backups, expecially before large
> upgrades. :-)

Errm.. yeah, well, backups are always good but in this case any backup would have been as useless as tits on a bull. My objective was to upgrade GCC and my "backup" was portage-rescue.

/me now loving a nice up-to-date, non-broken system ;-)

--

|<eppy

--
gentoo-user@gentoo.org mailing list