Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I've gone and broken portage...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Fri Feb 03, 2006 10:03 pm    Post subject: I've gone and broken portage... Reply with quote

I don't want to bore you all with details (and anyway, I can barely remember what I did ;))...

The basic rundown of what happened:
I changed my USE flags to try and remove X11, GNOME and all that stuff - this box is now headless and I didn't need any of it

Various steps later and forcing unmerges on certain packages and I got rid of most of it

emerge -uav system (fine)

emerge -uav world (fine)

etc-update (fine)

revdep-rebuild -p (at this point, it's showing TONS of GNOME-related junk I don't want so I didn't run it without the p)

emerge --prune --deep -a world (nothing seemed amiss here, I checked on a couple of packages with equery and decided to go ahead with the prune)

Then I tried to run:
emerge --depclean -a

And got...
"/usr/bin/python: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory"

I had a brief search of the Forum but all I saw suggested reinstalling the entire system...

Basically, what do I need to do to fix this without losing my current config. I want to end up with a fairly basic headless setup and I maintain my own installations of Apache2/PHP5/MySQL5 (this is a dev box). I don't care how long it takes me to fix, but a format really isn't an option for various reasons. Minimal downtime would be nice and, as Apache etc is still currently working, if it comes down to it I'll just leave the box in this broken state for the next month (major project on the go!) and then junk it.

No doubt I've missed lots of info out, so please ask. I'm far from an expert with portage/emerge (and Gentoo in general, if I'm honest) but my base system is 2005.0 (originally installed 2004.3 I think), my processor is an Athlon XP and I'm running gcc 3.3.6. I was briefly on 3.4.something but apparently it's disappeared. Yes, I know I probably removed it with prune but I'd swear it wasn't on the list and I'd switched profile to 3.4.x with gcc-config before. Either way, I've told gcc-config to use 3.3.6 again.

Any and all help greatly appreciated, I'm really at a loss here and I can't afford to junk this box now :)

HB
Back to top
View user's profile Send private message
freelight
Apprentice
Apprentice


Joined: 12 Jun 2004
Posts: 295
Location: NYC, NY, USA

PostPosted: Fri Feb 03, 2006 10:10 pm    Post subject: Reply with quote

The best way to have a clean box in your situation is to back up /etc (and anything else you'd like to keep) and reinstall. Other than that, get a binary of glibc (from a packagecd or some binary repository on the web somewhere) and extract it onto your box, then emerge --newuse --deep world. Be sure to make a blood sacrafice during the compile and pray to the Dark Lord for mercy unto your box.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Fri Feb 03, 2006 10:19 pm    Post subject: Reply with quote

Thanks, I appreciate the quick reply :)

I've got the packagecd from 2005.1 downloading now, but it's going to take a couple of hours.

If anyone could come up with some guidelines for how best to replace glibc etc, I would be very grateful. And I might be able to downgrade the sacrifice from a cow to a goat ;)

Do I need a new/different version of gcc or any of the other toolchain components? Where do I put glibc from the CD/How do I do it?

Thanks again,

HB
Back to top
View user's profile Send private message
freelight
Apprentice
Apprentice


Joined: 12 Jun 2004
Posts: 295
Location: NYC, NY, USA

PostPosted: Fri Feb 03, 2006 10:24 pm    Post subject: Reply with quote

To replace glibc,
Code:
cd / && tar xvjf /path/to/glibc-xx.xx.tbz2

See if that fixes Python. This is dirty, but it's saved my boxen in the past. If not, see what package the offending file belongs to and replace that as well. To check what it belongs to,
Code:
equery b /path/to/file

Once you can happily emerge stuff, run
Code:
emerge --newuse --deep --ask world
and after that's done,
Code:
emerge -eav world
to make everything completey kosher.

[EDIT]Oh, I seem to have misread your post. glibc is unlikely to be the culprit. Look into replacing gcc and libstdc++-v3.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Fri Feb 03, 2006 10:32 pm    Post subject: Reply with quote

Harry Bo,

I has some of this the other day when I managed to do
Code:
rm -r /etc
instead of
Code:
rm -r ./etc
Don't try that at home.
Essentially your currently selected gcc either does not exist or is badly broken.

Run
Code:
gcc-config -l
and try using each gcc in turn. If you are lucky, your system will be fixed when you select a working gcc.
and sort out the environment as instructed at the end of the command. Now try to emerge gcc. It does not require a completely functional gcc to do that as it has a bootstrap mode. The first part is written in C (not C++) and you have lost the c++ library that the full gcc requires. Luckily the first part of emerge gcc builds that for you.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Fri Feb 03, 2006 10:40 pm    Post subject: Reply with quote

freelight: Thanks a lot. I'll give that a go when I've finished downloading the ISO. Fingers crossed...

Neddy: Bad luck with /etc there, I cunningly did an "rm -rf /usr" a couple of years back ;)

Regarding gcc-config, all I have listed is 3.3.6 and it's various hardened variants.

emerge gcc fails with the python error given above.

HB
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Sat Feb 04, 2006 2:09 am    Post subject: Reply with quote

Harry Bo,

You probably still have a working gcc there somewhere but the config is trashed.
I got mine back by copying a config from another PC and changing the i686 bits to i585, since was copying from a CHOST i686 to i585 box.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9236
Location: beyond the rim

PostPosted: Sat Feb 04, 2006 2:51 am    Post subject: Reply with quote

The problem is that your python is linked to libstc++.so.6 which is part of gcc-3.4, so when you removed that your broke python (and anything else linked to it). glibc has nothing to do with that, you'll need to get gcc-3.4 back.

Last edited by Genone on Sun Feb 05, 2006 3:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Sat Feb 04, 2006 3:03 am    Post subject: Reply with quote

OK, that makes sense. I suppose the obvious question is: how do I compile gcc 3.4 and get it working without emerge/portage/Python? I've just downloaded a stage3 tarball for my processor arch., is gcc 3.4 on there? :)

Thanks,

HB
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Sat Feb 04, 2006 12:53 pm    Post subject: Reply with quote

Harry Bo,

You need a trusted friend (or another PC) to make you a binary of gcc-3.4 that you can use, so you can install the parts by hand.
I can do you gcc-3.4 for Athlon XP, P3 or k6-2. You will need to rebuild it for yourself first thing after it works.

I say "trusted friend" because you have no way to check the integerty of the tarball - it could contain anything.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Sat Feb 04, 2006 5:23 pm    Post subject: Reply with quote

OK...

Well, I have a second box sitting around (currently Win2k Pro) that's either going to get Gentoo, Ubuntu or CentOS put on it sometime soon. It's a Celeron (P3 era) chip, is that good enough?

If I install the newest Gentoo release on it, what will I need to do to produce a gcc-3.4 binary I can move onto my crippled machine?

Cheers,

HB
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Sat Feb 04, 2006 11:08 pm    Post subject: Reply with quote

Harry Bo,

Whats your crippled machine?
As long as you make a compiler that can run on both, you will be OK.
I can post a P3 binary for you if you want.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Sat Feb 04, 2006 11:21 pm    Post subject: Reply with quote

The "crippled" one is the subject of the original post (Athlon XP). I intend to use the Celeron machine to build a new version of gcc for the Athlon :)

HB
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Sun Feb 05, 2006 11:59 am    Post subject: Reply with quote

Harry Bo,

That will be ok as long as you make a generic i686 or a P3 compiler. A P4 compiler may not run.
Celerons were/are available based on P2, P3 and P4s.
You can get a binary gcc that will run on an XP here
I forget if its XP or P3 but I don't have anything that won't run on your XP.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Mon Feb 06, 2006 7:05 pm    Post subject: Reply with quote

Back again...

Neddy, I'm downloading gcc-3.4.4 from the address you gave as I type this. I assume all I need to do is extract it to / and then use gcc-config to switch back to 3.4.4?

EDIT: I've done ^ now, gcc seems to be in place and working. Running "emerge --newuse --deep world" now, with "emerge -eav world" to follow :)

Thanks all, it seems to have worked (fingers crossed ;))

HB
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Mon Feb 06, 2006 7:50 pm    Post subject: Reply with quote

Harry Bo,

You should have emerged gcc for yourself, with the gcc you got from me then used your own new gcc to update your system.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Harry Bo
n00b
n00b


Joined: 02 Aug 2005
Posts: 8
Location: Burton-on-Trent, UK

PostPosted: Mon Feb 06, 2006 9:03 pm    Post subject: Reply with quote

"emerge --newuse --deep world" got gcc-3.4.4 and compiled it for me, so that's done :)

HB
Back to top
View user's profile Send private message
funkeejeffou
n00b
n00b


Joined: 06 Feb 2005
Posts: 23

PostPosted: Fri Feb 17, 2006 10:14 am    Post subject: Reply with quote

Hi,

Well I've got the same problem here, but the way I managed to get there is :
the first emerge was a typo....
Code:
emerge -C glib
emerge --oneshot glib (o fix my error)


then, as I wanted to recompile glibc with my userlocales support and new USE flags :

Code:
emerge -C glibc


From there, I cannot run any command in a terminal, being "emerge" or a simple "ls", I am always having this python error...
What seems odd is that it appears to be a problem withh gcc (from what the forum says), but I actually messed up with glibc.

Could anyone tell me what exactly do I have to do, and I've also fetched for a glibc binary, but I couldn't find one. I'd appreciate if someone could tell me what are the functionnalities of glib and glibc, as I'd like to understand how my box has been so badly broken.

Cheers,
Jeff.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Fri Feb 17, 2006 10:43 am    Post subject: Reply with quote

funkeejeffou,

You have managed to remove glibc, which is a library that almost everything depends on.
You need a compatible correct version glibc for your install and CPU, then you will have to install it using the liveCD.
It won't be easy.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
funkeejeffou
n00b
n00b


Joined: 06 Feb 2005
Posts: 23

PostPosted: Fri Feb 17, 2006 10:58 am    Post subject: Reply with quote

Hi NeddySeagoon,


I know it won't be easy, but me neither I don't want to compile my gentoo from scratch again.
I've been thinking, what about using a liveCD, setting up my ADSL connection and then emerging as a binary file glibc with my previous USE flags.
I can then decompress (but how ?) the package, I mount my gentoo partition on /mnt/gentoo, and finally copy each files of the glibc binary to its correct path.

My questions, how can I decompress an gentoo binary, and how do I guess the path of each file?

Does this seems correct ?

Thanks in advance,
Jeff.
Back to top
View user's profile Send private message
funkeejeffou
n00b
n00b


Joined: 06 Feb 2005
Posts: 23

PostPosted: Fri Feb 17, 2006 12:41 pm    Post subject: Reply with quote

Ok, I've tried my idea but in fact, we cannot emerge with a liveCD...

So I guess I just need a binary from someone kind enough to build it for me. If anyone want to help me, I can post my architecture and USE flags, I would really appreciate (AMD64).

I think by tar balling directly to my root directory from the liveCD should fix my issue.
Will I have a problem with the shared libraries cache by the way? As I cannot run ldconfig, how could I achieve updating my list of shared libraries?

Cheers,
Jeff.

PS : please, someone help me, I'm getting mad under windows...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Fri Feb 17, 2006 1:59 pm    Post subject: Reply with quote

funkeejeffou,

You cannot use your broken distro for this but you are on the right lines.
What is in your CFLAGS and CXXFLAGS on the dead system?
I can provide a glibc tarball for some arch that may get you going so you can boot and rebuild your own.

I think using tar with the change direcory option will work for the install, since the tarball will have the correct path names.
busybox tar, as used by the liveCD may not support that option, so the tarball may need to be copied to the right place.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
funkeejeffou
n00b
n00b


Joined: 06 Feb 2005
Posts: 23

PostPosted: Fri Feb 17, 2006 3:47 pm    Post subject: Reply with quote

Thanks a lot NeddySeagoon,


I'll post here my make.conf :
Code:
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j2"

USE="3dnow alsa dvdr X alsa -arts -bluetooth cdparanoia cdr cups dvd dvdr emacs esd ffmpeg ginac glut -gnome gtk2 imagemagick -java jikes -joystick -kde -kdeenablefinal -kdexdeltas lm_sensors mad matroska mozilla mp3 mpeg msn multilib ncurses nls nptl ogg opengl -pcmcia -pda pdflib plotutils -smartcard sse sse2 -tcltk tetek truetype unicode usb -voodoo3 vorbis -wifi win32codecs -wxwindows -xine -xinerama xmms yahoo"

LINGUAS="fr en"


And my glibc has been built with locales.build :
Code:
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
fr_FR/ISO-8859-1
fr_FR@euro/ISO-8859-15
fr_FR.UTF-8/UTF-8


I know I've posted more than enough, but it was just in case of you wanted to specify these on the command line of emerge (or temporarly in your profile).
Also, what about the ldconfig stuff? Won't I have have problems compiling sources depending on glibc ?

I greatly appreciate your help, thanks.

Cheers,
Jeff.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43007
Location: 56N 3W

PostPosted: Fri Feb 17, 2006 4:59 pm    Post subject: Reply with quote

funkeejeffou,

I don't have an x86_64 box, so I can't make any 64 bit packages easily.
Ask in #gentoo on irc.

I can help with the install after you get one.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Tue Feb 28, 2006 11:16 pm    Post subject: Reply with quote

Moved from Portage & Programming to Duplicate Threads in favour of this FAQ: Error while loading shared libraries: libstdc++.so.5.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum