[Techtalk] old problem with Debian unstable libc6 and tar

Almut Behrens almut_behrens at yahoo.com
Mon Aug 27 11:00:26 EST 2001


On Sun, Aug 26, 2001 at 08:47:51PM +1000, Claudine wrote:
> 
> I attempted to upgrade libc6 to the broken 2.2.3-10 package one or 
> two weeks ago.  This had an undefined symbol "atexit" which caused 
> many programs to complain, among them sed, tar and shar.  
> The problem is supposed to have been fixed in libc6 2.2.3-11, 
> but I can't install any .debs because of tar.
> 
> tar: error while loading shared libraries: tar: undefined symbol: atexit
> dpkg-deb: subprocess tar returned error exit status 127
> dpkg: error processing /tmp/libc6_2.2.4-1_i386.deb (--install):
>  subprocess dpkg-deb --control returned error exit status 2
>  Errors were encountered while processing:
>   /tmp/libc6_2.2.4-1_i386.deb
> 
> Attempting to downgrade to libc6 2.2.3-9 has the same result.  
> Thinking it might be a problem with tar, I got the latest version 
> of the tar source in .shar.gz format, but unshar returned the same 
> error.

... this is a bit like being stuck in the middle of nowhere with a
broken car, desperately needing some spare parts which you can't fetch
because the car isn't working any longer :)

So what can you do to get out of this circular dependency?  (a) have
someone bring you the spare parts, (b) try to improvise yourself.

WRT the latter, I can't really think of much that you could try.
If you're lucky, you might still have an older version of libc around
for some reason.  Do a "ls -l /lib/libc[.-]*" and see if some older
version shows up. If yes, just make the symlink /lib/libc.so.6 point to
the appropriate version. I suspect, though, that apt-get has done its
job well and cleaned up properly... :)

In case you have another working linux box within reach, it's probably
easier to build statically linked versions of tar and gzip (you'll
probably need both if you want to deal with .tar.gz-files -- tar simply
calls gzip for the decompression functionality). Then, somehow transfer
them to your broken system and give things another go with these.
Statically linked programs have the advantage of being self-contained,
not needing any external libraries.

[you may skip the next paragraph if you do not intend to build those
binaries yourself]
To build the static versions, get the tar/gzip sources from a GNU
mirror, unpack them in some temp directory (tar hopefully works on
that other system ;) and basically build the stuff the usual autoconf
way.  This involves first running "./configure" and then "make" in
the temp directory ("make install" would not be required in this
particular case).  But before you run configure, set the environment
variable LDFLAGS to "-static". This will usually be recognized by the
autoconf mechanism and propagate this linker flag into the makefile.
In some cases it might not work, though ... if so, simply edit the
Makefile(s) yourself after running configure (i.e. search for a line
starting with LDFLAGS and append -static to that line). If things work
as expected, you'll find the executable either in some src subdirectory
or in the current/temp dir.  Also, if size matters when transferring
the binaries to the broken system (e.g. via floppy) do a "strip tar" --
this will significantly reduce size. To be sure, check with "ldd tar"
whether you've really built a statically linked program (in that case,
ldd should simply print something like "not a dynamic executable" or
"statically linked", and *no* mention of libc.so).

If you don't have a second box around, or if you'd rather not go into
this, just let me know -- it wouldn't be too much trouble for me to
send you statically linked versions of tar and gzip (sizes are: 460kB
for tar plus 350 kB for gzip, multiplied by 1.35 for base64 mail
transfer encoding). And don't hesitate to ask if it turns out that
you do need some other tools as well.

I'm running debian-sid (unstable) on one of my machines myself, so I
keep static versions of all the essential system administration tools
around -- just for the peace of mind ;) (hosed shared libraries are a
wonderful way to share bugs and break many things in a single go...;)

Good luck,

- Almut





More information about the Techtalk mailing list