How to install libprotobuf? - linux

By mistake i have deleted these libraries. I couldn't find a right way to reinstall it.
/usr/lib/x86_64-linux-gnu/libprotobuf.so.8
/usr/lib/x86_64-linux-gnu/libprotobuf-c.so.0
To fix it, i tried to follow these instructions, https://github.com/google/protobuf/blob/master/src/README.md
but ended up with different version. Now while compiling my code it throws this error. How can i get my previous version back?
error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory

Unknown OS: Installing the three packages providing libprotobuf.so.8, libprotobuf-c.so.0, libprotoc.so.8 →
sudo apt install --reinstall libprotobuf8 libprotobuf-c0 libprotoc8
HOWTO decide a package :
sudo apt install apt-file
apt-file search libprotoc.so.8
http://packages.ubuntu.com/search?keywords=libprotoc&searchon=names

Related

python3: can't install psycopg2 [duplicate]

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

Installing octave in termux, "Unable to correct problems, you have held broken packages"

I am trying to install octave from the "Its Pointless" repository mentioned in the termux wiki. The repository is added successfully as far as I can tell. However, when I try the command pkg install octave I get the error "octave Depends openblas" "octave Depends arpack-ng" "Unable to correct problems, you have held broken packages"
I have run dpkg --get-selections | grep held but it doesn't return anything.
When I try to run pkg install openblas it gives the error "openblas Depends libgcc but it is not installable"
When I try to run pkg install libgcc it gives the error "package libgcc is not available but is referred to by another package, this may mean the package is missing, has been obsoleted, or is only available from another source. However, the following packages replace it: ndk-sysroot"
After searching some more I did pkg install clang but I still get the same errors. ndk-sysroot has been installed during installation of clang.
I have done apt-get autoclean, apt-get autoremove and apt-get purge but that did not do anything.
What can I do to fix this problem and install octave on my phone?
The problem got solved by itself.
I tried pkg install octave again and got a response saying "The repository https://termux.net stable Release is no longer signed."
So I ran the command bash setup-pointless-repo.sh again.
And that was it! pkg install octave is now working.

Sqlite libsqlite3.so.0 Not Found

I'm trying to get sqlite3 to work on ubuntu linux. I first tried to download sqlite3 but was given an error about multiple versions. I then deleted libsqlite3.so.0 and another counterpart to that using gksudo natalie, which was recommended. I then reinstalled the two rpm files...I now have eight of them and the whole thing is blowing up and I'm frustrated and tired. Is there anyone who can tell me how to clean install the entire thing, sqlite3, rpms and all? I've just about had it. This is the error I'm getting now.
sqlite3 mydatabase.db
sqlite3: error while loading shared libraries: libsqlite3.so.0: cannot open shared object file: No such file or directory
If sqlite3 is not installed, simply installing it may resolve your issue -
sudo apt-get install sqlite3
WARNING - Purging packages can be risky. You might try install before purging/install.
You might be using a different version of Ubuntu but chances are this will work
http://ubuntuforums.org/showthread.php?t=1883976
sudo apt-get purge sqlite3 sqlite3-doc libsqlite3-0
sudo apt-get install sqlite3 sqlite3-doc
if you can use a terminal this should be fast and easy.

How to fix Error 2 when trying to make haskell-platform?

I downloaded the Haskell-platform source from here: http://www.haskell.org/platform/linux.html, installed ghc, and did /.configure. However when I do sudo make, I get the following error:
Preprocessing library HUnit-1.2.4.2...
Test/HUnit/Base.hs:1:1:
Could not find module `Prelude'
Perhaps you haven't installed the profiling libraries for package `base'?
Use -v to see a list of the files searched for.
Error:
Building the HUnit-1.2.4.2 package failed
make: *** [build.stamp] Error 2
Does anyone knows how to fix this?
I'm trying to install on Ubuntu 12.04.1 LTS
Instead of trying to install from the sources, simply install the Ubuntu packages, which will be much simpler, with:
$ sudo apt-get install haskell-platform
If you need a local version of the documentation and the profiling libraries, install the additional packages with:
$ sudo apt-get install haskell-platform-doc haskell-platform-prof
Daniel Fisher's comment led me to the solution. You have to install all the profiling libraries for each of the ghc packages you have installed.
Just write
sudo apt-get install ghc*-prof
That's how it worked for me

libstdc++.so.5: cannot open shared object file - but library is installed and up-to-date

My client had some developer write a small c++ command-line app to run on their Linux servers. On one of the servers (running Fedora 11), when I execute the app I get the following error:
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
Obviously the first thing I did was
yum install libstdc++
But I get
Package libstdc++-4.4.1-2.fc11.x86_64 already installed and latest version
So the library already exists and is up-to-date. Usually to me these errors indicate a missing library. So where should I look next?
rpm hence the repo knows about shared library names and what provides them. So
yum install 'libstdc++.so.5'
wiil install whatever is necessary if the repo has it.
In your case it would fetch compat-libstdc++-33-3.2.3-66.i586.rpm and its 32-bit deps if you don't have them already because the binary you are trying to run is apparently 32-bit
libstdc++-4.4.1-2.fc11.x86_64 installs libstdc++.so.6. You need the compat-libstdc++-33-3.2.3-66.x86_64 package to get libstdc++.so.5. (Do not symlink! libstdc++.so.5 and libstdc++.so.6 are incompatible.)
yum install compat-libstdc++-33 solved this for me.
libstdc++.so.5 is a very old version of the standard c++ library.
Do a yum search libstdc++ , you'll have to install one of the compat-libstdc++ packages.
As stated by caf and aaron, running yum install compat-libstdc++-33 libstdc++.so.5 -y worked for me when I got a similar error.
The only catch I ran into was, I didn't have the correct repo checked out so I had to run yum-config-manager --enable rhel-7-server-optional-rpms to access the files. If you are using something other than RedHat 7 you will need to search for the correct repo.
You could always check if you have the correct repo by running yum provides libstdc++.so.5 first.
worked for me too on RedHat 7 : error was :
error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS32
The solution was :
yum install compat-libstdc++-33 libstdc++.so.5 -y
Have you checked that the package does install libstdc++.so.5 and not some other version? That's your most likely problem.

Resources