Use the "file" command.
I found a very old backup of a 16.04 desktop that was 32-bit:
Code:
# file esniper
esniper: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cebbc46154d476652a57ae05666eff10ceb7c342, with debug_info, not stripped
When I try to run it on a 20.04 system (64-bit only), I see
Code:
$ esniper
esniper: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
However, that library as a 64-bit version, exists on the machine:
Code:
$ ll /usr/lib/x86_64-linux-gnu/libcurl.so*
lrwxrwxrwx 1 root root 16 Sep 10 10:28 /usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.6.0
-rw-r--r-- 1 root root 588424 Sep 10 10:28 /usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0
The 'file' for that library:
Code:
$ file /usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0
/usr/lib/x86_64-linux-gnu/libcurl.so.4.6.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c74e00b5bbd2ef8308c8c53e4e8a0385604ee2b4, stripped
My 16.04 32-bit backup doesn't have system stuff, so I can't find libcurl.so.4 under /usr/lib/ . I don't backup that area on my systems. I do backup /usr/local/*, but not things that would be installed with a normal installation and patch cycle. Sorry.
Not certain I've answered your question, but use 'file' to check any compiled library or program for the architecture it uses.
Just for fun, I looked on a Raspberry Pi - that's an ARM CPU.
Code:
$ file /usr/lib/arm-linux-gnueabihf/libcurl.so.4.5.0
/usr/lib/arm-linux-gnueabihf/libcurl.so.4.5.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=d8406507a355832fb2cc13712575f2dc603dcb7d, stripped
32-bit ... because that CPU is 32-bit.
Compiled library and program developers have to worry about these things all the time. Basically it is for C/C++/C#/pascal/rust people. Java and all the scripted language devs don't have to worry about this.
Bookmarks