Score:1

How to install libprotobuf.so.7 on ubuntu 20.04 machine?

za flag

I see this message while running a program.

error while loading shared libraries: libprotobuf.so.7: cannot open shared object file:

How can I install libprotobuf.so.7?

I'm on ubuntu 20.04. I tried apt-file libprotobuf.so.7 but it gives me nothing. I tried sudo apt install libprotobuf7 or for libprotobuf-c and it cannot locate the package. How can I do that?

My OS version :

LSB Version:    core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:    20.04
Codename:   focal

ADD :
I found these files already installed in my system.

/usr/lib/x86_64-linux-gnu/libprotobuf.so.17
/usr/lib/x86_64-linux-gnu/libprotobuf.so
/usr/lib/x86_64-linux-gnu/libprotobuf.so.17.0.0

so linked /usr/local/lib/libprotobuf.so.7 to /usr/lib/x86_64-linux-gnu/libprotobuf.so. (/usr/local/lib2 is in LD_LIBRARY_PATH`). But when I execute the program I see :

cm7_tarmac_decode: error while loading shared libraries: libprotobuf.so.7: wrong ELF class: ELFCLASS64

I figure this libprotobuf.so.17 is for x86_64 machine when the program (cm7_tarmac_decode) is looking for a 32 bit version.

so using apt-cache search protobuf I thought libprotobuf17 is my package and because it should be for 32 bit , I tried sudo apt install libprotobuf17:i386 and it installed some files.
dpkg libprotobuf17:i386 shows these installed files.

/usr
/usr/lib
/usr/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu/libprotobuf.so.17.0.0
/usr/share
/usr/share/doc
/usr/share/doc/libprotobuf17
/usr/share/doc/libprotobuf17/changelog.Debian.gz
/usr/share/doc/libprotobuf17/copyright
/usr/lib/i386-linux-gnu/libprotobuf.so.17

So under /usr/lib32, I did

/usr/lib32$ sudo ln -s /usr/lib/i386-linux-gnu/libprotobuf.so.17 libprotobuf.so.7

(faking version 17 is version 7). But when I excute the program I got this error message.

cm7_tarmac_decode: symbol lookup error: cm7_tarmac_decode: undefined symbol: _ZN6google8protobuf8internal12kEmptyStringE

This means the libprotobuf.so.17 doesn't have the symbol _ZN6google8protobuf8internal12kEmptyStringE which is in real libprotobuf.so.7 file.
I tried sudo apt install libprotobuf7:i386 but there is no such package.

ADD2 :
see Tooster's answer below. but before seeing that answer, I received libprotobuf.so.7 file from my colleague and used it.

Pilot6 avatar
cn flag
What are you trying to do when you see this message?
PonJar avatar
in flag
When you install a package it contains lots of files. A file with a name like libprotobuf.so.7 is likely to be one of those files. If you really need to install something to provide that file then you need to find the package that contains it. Usually it will be a dependency of what ever you are using that results in the error you are having. On Arch Linux there is a package called protobuf so there may be something similar in the Ubuntu repositories
PonJar avatar
in flag
What package are you using when you get this error? Where did you get this package? What are you trying to do? If you reinstall the package you are using and it comes from the Ubuntu repositories it may fix the dependencies. If it came from somewhere else check for any installation instructions and in particular any info about dependencies
Tooster avatar
cn flag
I think it is an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). First, like Pilot6 said, explain what are you trying to do with that, because this smells of bad assumptions and erroneously self-diagnosed problem. [Here is something related to your problem](https://developer.arm.com/documentation/ka001290/latest), but I didn't find other references about what `cm7_tarmac_decode` is.
Score:0
cn flag

This is an attempt at answering based on little info in the web:

Based on this thread (a note in the middle about requiring protocol buffers 2.4.1) as well as this thread You can try installing protobufs in the version 2.4.1 for 32 bits and later use LD_LIBRARY_PATH to set path to the installed buffers, for example using something similar to (note that it's temporary):

setenv LD_LIBRARY_PATH /arm/tools/google/protobuf/2.4.1/rhe5-x86_32/lib:/arm/tools/google/protobuf/2.4.1/rhe5-x86_64/lib:$LD_LIBRARY_PATH

or whatever path you will install that at. For more info you could try going to this or this thread.

za flag
Hi I didn't know arm provided such information about protobuf 2.4.1 (which generates libprotubuf.so.7?). Yestereday, I received libprotobuf.so.7 file from my colleague and was able to use the cm7_tarmac_decode program while simulation. Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.