LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Accidentally deleted gawk and now nothing will configure :( (http://www.linuxquestions.org/questions/programming-9/accidentally-deleted-gawk-and-now-nothing-will-configure-840719/)

grail 10-27-2010 05:42 AM

Accidentally deleted gawk and now nothing will configure :(
 
So unbeknownst to me until today, but apparently all configure scripts rely on some version of awk to create the Makefile when config.status is run.

Anyone have any suggestions on how to get gawk reinstalled?

I have compiled one on Ubuntu and copied it to my other machine but when run it throws the error:
Code:

./gawk: no such file or directory
So I am guessing I either need to create a static copy or maybe also copy the libs created from compile with it.

Any suggestions greatly appreciated :)

GrapefruiTgirl 10-27-2010 05:50 AM

Which OS did you remove the gawk from? Is there no package manager that can be used to reinstall it?

The error is "file not found", so at this stage of course, missing libraries are not the problem, it's the binary itself. Can you stick a gawk binary into /usr/bin and/or into /bin and see if that helps?

For the record, the gawk package on my Slack box does not bring with it anything that goes in any /lib dir, only binaries in /bin and /usr/libexec/awk. The gawk binary claims dependence on:
Code:

root@reactor: ldd /usr/bin/gawk
        linux-vdso.so.1 =>  (0x00007fff64dff000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007eff86c72000)
        libm.so.6 => /lib64/libm.so.6 (0x00007eff869ee000)
        libc.so.6 => /lib64/libc.so.6 (0x00007eff8666c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007eff86e76000)
root@reactor:


crts 10-27-2010 08:39 AM

Quote:

Originally Posted by GrapefruiTgirl (Post 4140771)
The error is "file not found", so at this stage of course, missing libraries are not the problem, it's the binary itself.

Hi,

this is generally true. When a binary a binary is missing a shared library it displays an error like:
Code:

ls: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
However, there is one exception. If a binary cannot find its linker, then it will throw a simple 'No such file or directory' error. Just like the binary itself were not present. It's really funny when you do 'ls' and are looking at the file at the same time.

So this is what I think *might* be going on:
ldd on my Ubuntu returns:
Code:

# ldd /usr/bin/gawk
        linux-vdso.so.1 =>  (0x00007fffe8c6c000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f22571be000)
        libm.so.6 => /lib/libm.so.6 (0x00007f2256f3b000)
        libc.so.6 => /lib/libc.so.6 (0x00007f2256bb7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f22573e0000)

My guess is, that on the target-system there is no directory /lib64. It is probably NOT a multilib system. It misses the /lib64 directory and the linker might be also named just ld-linux.so.2 (not sure about that).
In this case, creating a symlink /lib64 -> /lib (and also one for the linker) *might* solve the problem. The output of
Code:

ls -l /lib*/ld-*
ldd /path/to/gawk  # the temporary one from ubuntu

could come in handy.
If it works with the symlinks, then recompilation of gawk on the target system should be possible.

grail 10-27-2010 09:36 AM

Thanks for the feedback folks. I am not near the culprit at the moment so it will have to wait until tomorrow to try your advice :(

More background:

I built my own CLFS Pure 64 (hence crts correct about no /lib64)
Quote:

Originally Posted by GrapefruiTgirl
Is there no package manager that can be used to reinstall it?

This made me laugh a little, not at you, but the reason for losing gawk was the package manager I have built deleted it :redface:

So in answer to your question, not until I fix this problem :)

I will throw an update in first thing tomorrow after I try the symlinks idea (sounds plausible to me)

Cheers

GrapefruiTgirl 10-27-2010 09:53 AM

Quote:

Originally Posted by grail (Post 4141001)
This made me laugh a little, not at you, but the reason for losing gawk was the package manager I have built deleted it :redface:

:D lol

Looking forward to the update. Good luck!

crts 10-27-2010 10:12 AM

Quote:

Originally Posted by grail (Post 4141001)
This made me laugh a little, not at you, but the reason for losing gawk was the package manager I have built deleted it

Oh, such irony...:)
Quote:

I built my own CLFS Pure 64
Do you still have a copy of your toolchain somewhere? If yes, it should be possible to use the toolchains version of gawk. Temporarily add /tools/bin to your path and rebuild gawk on the CLFS machine.
But since you already have the ubuntu version copied over, could you first try if symlinks might make gawk work again? Would be interesting to know.

grail 10-27-2010 06:38 PM

Quote:

Do you still have a copy of your toolchain somewhere?
Wouldn't this have been a lovely thing to still have :(

BUT .... you will be happy to know that it is all back up and running and it was thanks to adding /lib64 as symlink :)

My linker was already named the same so didn't have to add one for it.

I have now added a line in when installing gawk to copy it to /tmp until I know it has installed correctly <whew>

Thanks again

crts 10-27-2010 07:38 PM

Great it worked out. I was a bit skeptical. Since it compiled against Ubuntu I thought that there might arise some compatibility issues.
Quote:

Wouldn't this have been a lovely thing to still have
Maybe next time ;)


All times are GMT -5. The time now is 09:15 PM.