General
cancel
Showing results for 
Search instead for 
Did you mean: 

How to bundle the expect libraryies

gavisiddappa
Occasional Contributor

How to bundle the expect libraryies

Hi all,

I am using the expect tool automate the ssh connection. I downloaded the source code and built it and installed , it is working fine.

I get snashot of the working expect depandancies using ldd command:
ldd /usr/local/bin/expect
linux-gate.so.1 => (0x00f38000)
libexpect5.44.1.so => /usr/local/lib/expect5.44.1/libexpect5.44.1.so (0x0084c000)
libtcl8.5.so => /usr/local/lib/libtcl8.5.so (0x00c46000)
libdl.so.2 => /lib/libdl.so.2 (0x00110000)
libm.so.6 => /lib/libm.so.6 (0x00114000)
libc.so.6 => /lib/libc.so.6 (0x00add000)
libutil.so.1 => /lib/libutil.so.1 (0x00a7c000)
/lib/ld-linux.so.2 (0x00abf000)

My problem is how to bundle these libraries and exe of expect and to install on the another linux machine instead of building again the source code on new linux machine.
These are the exe and .so files.
expect
libc.so.6
libexpect5.44.1.so
libtcl8.5.so
ld-linux.so.2
libdl.so.2
libm.so.6
libutil.so.1
expect

I tried to copy all the shared libraries and expect exe to corresponding folders on new linux machine and execute the expect command it cause the segmentation fault.

[root@localhost exeptlib]# expect
Segmentation fault

Thanks in advance.
Gavi
4 REPLIES
Huc_1
Honored Contributor

Re: How to bundle the expect libraryies

Why not install expect on other system using usual methods ? (yum, rpm, dpkg,,, etc)

Surely you have root access since you are able to populate with your copies to the library on the target systems.

Also, you need to be sure target requirement and dependencies, kernel are the same or compatible with the system you got the file /usr/bin/expect from.

on a system here (Fedora 11) I get

# ldd /usr/bin/expect
linux-gate.so.1 => (0x006ac000)
libexpect5.43.so => /usr/lib/libexpect5.43.so (0x00d11000)
libtcl8.5.so => /usr/lib/libtcl8.5.so (0x0042e000)
libdl.so.2 => /lib/libdl.so.2 (0x00d0a000)
libm.so.6 => /lib/libm.so.6 (0x00ce0000)
libutil.so.1 => /lib/libutil.so.1 (0x00b40000)
libc.so.6 => /lib/libc.so.6 (0x00b6d000)
/lib/ld-linux.so.2 (0x00b49000)

# file /usr/bin/expect
/usr/bin/expect: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

I hope this get you going.

Enjoy life.

Jean-Pierre Huc
Smile I will feel the difference
gavisiddappa
Occasional Contributor

Re: How to bundle the expect libraryies

Hi Jean-Pierre,

Thanks for your assistance.

I tried rpm files to install on the other machine but it shows multiple dependencies.

I tried to resolve the these dependencies it takes so much of time to download and install.

rpm -ivh expect-5.43.0-19.fc12.i686.rpm

error: Failed dependencies:
libc.so.6(GLIBC_2.11) is needed by expect-5.43.0-19.fc12.i686
libc.so.6(GLIBC_2.7) is needed by expect-5.43.0-19.fc12.i686
libtcl8.5.so is needed by expect-5.43.0-19.fc12.i686
rpmlib(FileDigests) <= 4.6.0-1 is needed by expect-5.43.0-19.fc12.i686
rpmlib(PayloadIsXz) <= 5.2-1 is needed by expect-5.43.0-19.fc12.i686


is there any easy way to install the expect from the rpm files? for different versions of linux os.

Thanks & Regards
Gavi
Matti_Kurkela
Honored Contributor

Re: How to bundle the expect libraryies

If you're downloading individual .rpm files and installing them with the "rpm" command, of course it will take a long time (and it will be a really boring job). That's why package managers like yum were developed.

For Fedora, try running "yum install expect". If yum is properly configured, it will automatically detect the dependencies, figure out the correct packages to download, and then download & install everything automatically.

Please see: http://prefetch.net/articles/yum.html

For distributions using .deb packages (Debian, *Ubuntu etc.), the corresponding command is usually "aptitude install expect" or (in older releases) "apt-get install expect".

By the way, libc.so is the common C library. Just about all the programs of any Linux distribution are dependent on it. Replacing a libc.so of a particular distribution with an older version is a very bad idea: you may end up with an unstable system that shows various, seemingly unrelated errors.

Security patches and bugfixes may bring minor updates to the libc.so file, but a major update to the C library is usually one of the reasons to release a new version of the entire Linux distribution (e.g. from Fedora 10 to Fedora 11).

MK
MK
gavisiddappa
Occasional Contributor

Re: How to bundle the expect libraryies

I download the correct version of rpm and currently it is working for x86_64 bit machine. Thanks for all your support.


Thanks & Regards
Gavi