Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I uninstall protobuf 3.0.0?

I used the instructions from here to install Protocol Buffer: https://github.com/google/protobuf/blob/master/src/README.md and ended up with version 3 ("protoc --version" "libprotoc 3.0.0")

However, I need a protoc version 2.

I tried to uninstall it with apt-get remove protobuf-compiler

But this is what I get and version 3 is still installed:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'protobuf-compiler' is not installed, so not removed
0 to upgrade, 0 to newly install, 0 to remove and 396 not to upgrade.

I am using Ubuntu 14.04 and "which protoc" command points at "/usr/bin/protoc"

I am looking to an alternative solution than given in Protocol Buffer: Version Change

I am not sure if I am using the correct command for uninstalling. Any suggestions?

like image 662
Voltronika Avatar asked Mar 09 '16 15:03

Voltronika


People also ask

How uninstall Protobuf Linux?

0-58-generic Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded. $ sudo apt-get install protobuf-compiler libprotobuf-dev $ sudo apt remove protobuf-compiler libprotobuf-dev Reading package lists... Done Building dependency tree Reading state information...

How do I downgrade Protobuf version?

You need to uninstall the newer one. If you installed it from source using make install , then go back to the source code directory and do make uninstall .

Where is Protobuf installed?

By default, 'make install' will install the package's files in '/usr/local/bin', '/usr/local/man', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PATH'. Yeah...


5 Answers

I managed to uninstall protoc 3.0.0 (I am posting the answer in a beginner manner, the way I needed it explained to understand):

1) The remove command does not work, because the instructions I followed on protocol buffer page uses make to build the tool - you only use remove when installing with apt-get

2) To remove all libraries built with make, go to the folder where the protoc files were downloaded and run make uninstall. That worked. However, when I checked again with protoc --version, I still got libprotoc 3.0.0. I think the reason is because I followed one of he instructions to change the path of the installation (./configure --prefix=/usr) and therefore I needed to use rm `which protoc` to manually delete the leftovers from protoc 3, because the make uninstall was not pointing to it. After that, protoc was completely gone.

3) I installed the version I needed (any protoc 2) with apt-get install protobuf-compiler and now I have libprotoc 2.5.0

Please feel free to comment further.

like image 106
Voltronika Avatar answered Oct 08 '22 09:10

Voltronika


I have used the command sudo apt-get remove protobuf-compiler and reference is How to remove protobuf-compiler from Ubuntu 14.04. Hope this helps!

like image 27
brian tse Avatar answered Oct 08 '22 07:10

brian tse


If you have Anaconda installed on Ubuntu, then use:

conda uninstall protobuf

After executing the above command, try:

protoc --version

The following output confirms the successful removal of protobuf:

The program 'protoc' is currently not installed. You can install it by typing: sudo apt install protobuf-compiler

In case you want to install the Google Protocol Buffer, watch this video: https://www.youtube.com/watch?v=EAFK-tN_yaw

like image 27
Parag Jain Avatar answered Oct 08 '22 07:10

Parag Jain


I just had the same issue and the problem was in usr/local/include/. It installs its header files while you were installing protoc from the source and when you uninstall it, it does not erase its include headers. Therefore, *.pb.cc files still try to include those files. I fixed the problem by removing protobuf header in usr/local/include/ and then reinstalling libprotobuf from apt-get.

like image 31
Orion9 Avatar answered Oct 08 '22 07:10

Orion9


On Fedora 29 sudo dnf remove protobuf removed my previously installed sudo dnf -y install protoc 3.5.0 version.

[dzintars@fedora ~]$ protoc
bash: protoc: command not found...
like image 36
Dzintars Avatar answered Oct 08 '22 07:10

Dzintars