试图在xubuntu 22.10上安装watchman的问题(使用了两种方法-编译和使用deb文件)



我正在尝试用react native设置我的pc进行一些android应用程序开发。按照react原生文档,建议安装watchman: https://reactnative.dev/docs/environment-setup

我已经尝试使用deb: watchman_ubuntu22.04_v2022.11.07.00.deb

,输出如下:

sudo dpkg -i watchman_ubuntu22.04_v2022.11.07.00.deb 
[sudo] password for sheila: 
Selecting previously unselected package watchman.
(Reading database ... 238878 files and directories currently installed.)
Preparing to unpack watchman_ubuntu22.04_v2022.11.07.00.deb ...
Unpacking watchman (20221102.224517.0) ...
dpkg: dependency problems prevent configuration of watchman:
watchman depends on libevent-2.1-7; however:
Package libevent-2.1-7 is not installed.
dpkg: error processing package watchman (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
watchman

从这里,我已经下载了libvent -2.1-7包deb,但是当试图安装它时,我得到以下冲突的包错误:

sudo dpkg -i libevent-2.1-7_2.1.11-stable-1_amd64.deb 
dpkg: regarding libevent-2.1-7_2.1.11-stable-1_amd64.deb containing libevent-2.1-7:amd64:
libevent-2.1-7a:amd64 conflicts with libevent-2.1-7
libevent-2.1-7:amd64 (version 2.1.11-stable-1) is to be installed.
dpkg: error processing archive libevent-2.1-7_2.1.11-stable-1_amd64.deb (--install):
conflicting packages - not installing libevent-2.1-7:amd64
Errors were encountered while processing:
libevent-2.1-7_2.1.11-stable-1_amd64.deb

有两个包裹丢失;Libgoogle-glog0v5_0.5.0 + realally0.4.0 -2_amd64和libevent。我可以安装libgoogle-glog0v5了

在这个阶段,有冲突的包是我寻求帮助的地方。我不知道如何解决这个问题。

我也尝试过构建watchman我采取的步骤是:

git clone https://github.com/facebook/watchman.git
cd watchman
git checkout -b v2022.11.07.00
sudo ./install-system-packages.sh
sudo ./autogen.sh

,我得到这个错误:

CMake Error at build/fbcode_builder/CMake/RustStaticLibrary.cmake:61 (find_program):
Could not find CARGO_COMMAND using the following names: cargo
Call Stack (most recent call first):
CMakeLists.txt:139 (include)

我有货物安装在终端运行命令cargo version返回cargo 1.65.0 (4bc8f24d3 2022-10-20)

我在运行。/autogen.sh时确实遇到了一些其他错误其中一个是

Linking CXX executable bin/watchman
FAILED: bin/watchman 

但是运行sudo ./autogen.sh似乎修复了这个错误。

感谢您花时间阅读本文。任何帮助都是伟大的

这是一个更大的终端块(我不确定该包括什么):

TpQjkMMS39M_KEls/lib/pkgconfig:
+ PYTHONPATH=
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303/lib/fb-py-libs/fb303_thrift_py:
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/lib/fb-py-libs/thrift_py_inspect:
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fbthrift/lib/fb-py-libs/thrift_py:
+      /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/python-six-a_PuBql0-TcavVCS0SYl5gjjcl7jCpIVWAuUaU9OOJM/lib/fb-py-libs/python-six:
+ SSL_CERT_DIR=/etc/ssl/certs 
+ THRIFT_INCLUDE_PATH=/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/installed/fb303/include/thrift-files 
+ cd /tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman && 
+ /usr/bin/cmake 
+      /home/sheila/Downloads/watchman 
+      -DCMAKE_INSTALL_PREFIX=/usr/local 
+      -DBUILD_SHARED_LIBS=OFF 
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo 
+      -G 
+      Ninja
-- PACKAGE_VERSION=20221102.224517.0, BUILD_INFO=2911933b5cc68cbb1d1d27adc38fad0f7bdc8efa
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found gmock via config, defines=, include=/usr/include, libs=GTest::gmock_main;GTest::gmock;GTest::gtest
CMake Error at build/fbcode_builder/CMake/RustStaticLibrary.cmake:61 (find_program):
Could not find CARGO_COMMAND using the following names: cargo
Call Stack (most recent call first):
CMakeLists.txt:139 (include)

-- Configuring incomplete, errors occurred!
See also "/tmp/fbcode_builder_getdeps-ZhomeZsheilaZDownloadsZwatchmanZbuildZfbcode_builder-root/build/watchman/CMakeFiles/CMakeOutput.log".
Command '['/usr/bin/cmake', '/home/sheila/Downloads/watchman', '-DCMAKE_INSTALL_PREFIX=/usr/local', '-DBUILD_SHARED_LIBS=OFF', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja']' returned non-zero exit status 1.
!! Failed

在Ubuntu 22.10上你可以简单地运行:

sudo apt-get -y install watchman

最新更新