当在Ubuntu 22.04上构建libvirt源码时,可能会遇到一些错误。下面是一些常见错误及其解决方法:
1. 错误:Program 'xmllint’未找到或不可执行
解决方法:安装libxml2-utils
sudo apt-get install libxml2-utils
2. 错误:Program 'xsltproc’未找到或不可执行
解决方法:安装xsltproc
sudo apt install -y xsltproc
3. 错误:Run-time dependency fuse3未找到
解决方法:安装libfuse3-dev
和libfuse-dev
sudo apt-get install libfuse3-dev
sudo apt-get install libfuse-dev
4. 错误:Run-time dependency glib-2.0未找到
解决方法:安装libglib2.0-dev
sudo apt-get install libglib2.0-dev
5. 错误:Pkg-config二进制文件未找到
解决方法:安装pkg-config
sudo apt-get install pkg-config
6. 错误:Run-time dependency glusterfs-api未找到
解决方法:安装libglusterfs-dev
sudo apt-get install libglusterfs-dev
7. 错误:Run-time dependency gnutls未找到
解决方法:安装libgnutls28-dev
sudo apt-get install libgnutls28-dev
8. 错误:Run-time dependency libiscsi未找到
解决方法:安装libiscsi-dev
sudo apt-get install libiscsi-dev
9. 错误:Run-time dependency libnbd未找到
解决方法:安装libnbd-dev
sudo apt-get install libnbd-dev
10. 错误:Run-time dependency libnl-3.0未找到
解决方法:安装libnl-3-dev
sudo apt-get install libnl-3-dev
11. 错误:Run-time dependency libnl-route-3.0未找到
解决方法:安装libnl-route-3-dev
sudo apt-get install libnl-route-3-dev
12. 错误:Run-time dependency libparted未找到
解决方法:安装libparted-dev
sudo apt-get install libparted-dev
13. 错误:Run-time dependency pcap未找到
解决方法:安装libpcap-dev
sudo apt-get install libpcap-dev
14. 错误:Run-time dependency libssh未找到
解决方法:安装libssh-dev
sudo apt-get install libssh-dev
15. 错误:Run-time dependency libssh2未找到
解决方法:安装libssh2-1-dev
sudo apt-get install libssh2-1-dev
16. 错误:Run-time dependency libxml-2.0未找到
解决方法:安装libxml2-dev
sudo apt-get install libxml2-dev
17. 错误:Run-time dependency wireshark未找到
解决方法:安装libwireshark-dev
sudo apt install libwireshark-dev
18. 错误:Run-time dependency yajl未找到
解决方法:安装libyajl-dev
sudo apt install libyajl-dev
19. 错误:Program xgettext未找到、Program msgfmt未找到、Program msgmerge未找到
解决方法:安装gettext
工具集
sudo apt-get update
sudo apt-get install gettext
20. 错误:Run-time dependency numa未找到
解决方法:安装libnuma-dev
sudo apt-get install libnuma-dev
21.docs/meson.build:176:2: ERROR: Program ‘rst2html5 rst2html5.py rst2html5-3’ not found or not executable
pip uninstall rst2html5
pip install docutils
22.安装所需的依赖库和工具:
sudo apt-get install libxml2-utils xsltproc pkg-config libfuse3-dev libfuse-dev libglib2.0-dev libglusterfs-dev libgnutls28-dev libiscsi-dev libnbd-dev libnl-3-dev libnl-route-3-dev libparted-dev libpcap-dev libssh-dev libssh2-1-dev libxml2-dev wireshark-dev libyajl-dev gettext libnuma-dev libopenwsman-dev libpciaccess-dev librbd-dev librados-dev libreadline-dev libsasl2-dev
pip uninstall rst2html5
pip install docutils
23.原始记录:
https://github.com/libvirt/libvirt.gitmeson.build:803:2: ERROR: Program 'xmllint' not found or not executable
sudo apt-get install libxml2-utilsmeson.build:803:2: ERROR: Program 'xsltproc' not found or not executable
sudo apt install -y xsltprocRun-time dependency fuse3 found: NO (tried pkgconfig and cmake)
Run-time dependency fuse found: NO (tried pkgconfig and cmake)
Run-time dependency glib-2.0 found: NO (tried cmake)meson.build:969:0: ERROR: Pkg-config binary for machine 1 not found. Giving up.sudo apt-get install pkg-config
sudo apt-get install libfuse3-dev
sudo apt-get install libfuse-dev
sudo apt-get install libglib2.0-devRun-time dependency glusterfs-api found: NO (tried pkgconfig and cmake)
Run-time dependency gnutls found: NO (tried pkgconfig and cmake)
sudo apt-get install libglusterfs-dev
sudo apt-get install libgnutls28-devRun-time dependency libiscsi found: NO (tried pkgconfig and cmake)
Run-time dependency libnbd found: NO (tried pkgconfig and cmake)
Run-time dependency libnl-3.0 found: NO (tried pkgconfig and cmake)
Run-time dependency libnl-route-3.0 found: NO (tried pkgconfig and cmake)
Run-time dependency libparted found: NO (tried pkgconfig and cmake)
pcap-config found: NO need ['>=1.5.0']
Run-time dependency pcap found: NO (tried pkgconfig and config-tool)
Run-time dependency libssh found: NO (tried pkgconfig and cmake)
Run-time dependency libssh2 found: NO (tried pkgconfig and cmake)
Run-time dependency libxml-2.0 found: NO (tried pkgconfig and cmake)# 安装libiscsi
sudo apt-get install libiscsi-dev# 安装libnbd
sudo apt-get install libnbd-dev# 安装libnl及其相关库
sudo apt-get install libnl-3-dev libnl-route-3-dev# 安装libparted
sudo apt-get install libparted-dev# 安装pcap(此处报错可能是由于版本要求,先尝试安装最新版)
sudo apt-get install libpcap-dev# 安装libssh
sudo apt-get install libssh-dev# 安装libssh2
sudo apt-get install libssh2-1-dev# 安装libxml2
sudo apt-get install libxml2-devRun-time dependency wireshark found: NO (tried pkgconfig and cmake)
Run-time dependency yajl found: NO (tried pkgconfig and cmake)
sudo apt install libwireshark-dev
sudo apt install libyajl-devProgram xgettext found: NO
Program msgfmt found: NO
Program msgmerge found: NO
Run-time dependency numa found: NO (tried pkgconfig and cmake)
Run-time dependency openwsman found: NO (tried pkgconfig and cmake)
Run-time dependency parallels-sdk found: NO (tried pkgconfig and cmake)
Run-time dependency pciaccess found: NO (tried pkgconfig and cmake)
Library rbd found: NO
Library rados found: NO
Run-time dependency readline found: NO (tried pkgconfig and cmake)
Library readline found: NO
Run-time dependency libsanlock_client found: NO (tried pkgconfig and cmake)
Run-time dependency libsasl2 found: NO (tried pkgconfig and cmake)
Run-time dependency libselinux found: YES 3.3
Run-time dependency threads found: YES
Run-time dependency libudev found: YES 249
Library util found: YES
Run-time dependency wireshark found: YES 3.6.2
Check usable header "wireshark/ws_version.h" : YES
Run-time dependency yajl found: YES 2.1.0
Program pkcheck found: YES (/usr/bin/pkcheck)meson.build:1452:2: ERROR: Problem encountered: You must install the pciaccess module to build with udev# 安装gettext工具集(包含xgettext, msgfmt, msgmerge)
sudo apt-get update
sudo apt-get install gettext# 安装numa库
sudo apt-get install libnuma-dev# 安装openwsman库
sudo apt-get install libopenwsman-dev# 安装parallels-sdk库(如果适用你的系统,否则跳过)
# 根据官方文档或源码自行编译安装# 安装pciaccess库
sudo apt-get install libpciaccess-dev# 安装rbd和rados库(Ceph库的一部分)
sudo apt-get install librbd-dev librados-dev# 安装readline库
sudo apt-get install libreadline-dev# 安装libsanlock_client库(如果可用,否则可能需要从源码编译)
# 根据官方文档或源码自行编译安装# 安装libsasl2库
sudo apt-get install libsasl2-dev# 已找到libselinux和libudev,无需额外安装# 已找到wireshark和yajl,无需额外安装# 虽然最后一条错误提示与pciaccess有关,但根据前面的日志,pciaccess已经找到了,可能是meson配置文件内部逻辑有误。
# 如果您确认pciaccess已安装并且版本符合要求,可以尝试清理并重新配置meson,或者检查项目的meson.build文件。Program rst2html5 rst2html5.py rst2html5-3 found: NOdocs/meson.build:176:2: ERROR: Program 'rst2html5 rst2html5.py rst2html5-3' not found or not executableA full log can be found at /root/CLionProjects/libvirt/buildDir/meson-logs/meson-log.txtpip uninstall rst2html5
pip install docutils