Voltronika
Voltronika

Reputation: 560

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?

Upvotes: 11

Views: 95426

Answers (5)

Dzintars
Dzintars

Reputation: 1571

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...

Upvotes: 1

brian tse
brian tse

Reputation: 157

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!

Upvotes: 6

Parag Jain
Parag Jain

Reputation: 355

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

Upvotes: 5

Voltronika
Voltronika

Reputation: 560

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.

Upvotes: 30

Orion9
Orion9

Reputation: 21

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.

Upvotes: 2

Related Questions