LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-27-2010, 06:42 AM   #1
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,690

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
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
 
Old 10-27-2010, 06:50 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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:
 
Old 10-27-2010, 09:39 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by GrapefruiTgirl View Post
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.

Last edited by crts; 10-27-2010 at 09:40 AM.
 
Old 10-27-2010, 10:36 AM   #4
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,690

Original Poster
Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
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

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
 
Old 10-27-2010, 10:53 AM   #5
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by grail View Post
This made me laugh a little, not at you, but the reason for losing gawk was the package manager I have built deleted it
lol

Looking forward to the update. Good luck!
 
Old 10-27-2010, 11:12 AM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Quote:
Originally Posted by grail View Post
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.
 
Old 10-27-2010, 07:38 PM   #7
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,690

Original Poster
Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
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
 
Old 10-27-2010, 08:38 PM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
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
 
  


Reply

Tags
awk, compile error, configure, gawk


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accidentally deleted partitions somae Linux - Hardware 3 01-13-2009 09:57 AM
I accidentally deleted libstdc++ :( piforever Fedora 4 01-01-2006 07:03 PM
Accidentally deleted files rwalkerphl Linux - Newbie 3 06-24-2004 07:11 PM
Accidentally deleted /etc/init.d .. what do i do? :| waste Linux - General 5 03-04-2004 04:39 AM
accidentally deleted /etc/profile tanbetien Fedora 2 11-21-2003 10:42 PM


All times are GMT -5. The time now is 09:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration