我最初安装了 protobuf 3.13.0,然后使用 apt remove 将其删除,但它没有被删除。
我什至按照这些说明从源代码安装了 protobuf 3.6.1,但仍然存在 3.13.0 https://askubuntu.com/a/1072684/165324
$ protoc --version
libprotoc 3.13.0
$ 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... Done
Package 'libprotobuf-dev' is not installed, so not removed
Package 'protobuf-compiler' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libprotobuf-lite17 libprotoc17 linux-image-5.4.0-58-generic linux-modules-5.4.0-58-generic
linux-modules-extra-5.4.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... Done
Package 'libprotobuf-dev' is not installed, so not removed
Package 'protobuf-compiler' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libprotobuf-lite17 libprotoc17 linux-image-5.4.0-58-generic linux-modules-5.4.0-58-generic
linux-modules-extra-5.4.0-58-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
安装 3.6.1 使用:
$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
$ tar -xvzf protobuf-all-3.6.1.tar.gz
$ cd protobuf-3.6.1/
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig
我注意到我有:
我在 ~/.bashrc 中添加了最后一行:
然后:
现在: