当前位置:   article > 正文

Ubuntu 22.04上构建libvirt源码错误解决

Ubuntu 22.04上构建libvirt源码错误解决

当在Ubuntu 22.04上构建libvirt源码时,可能会遇到一些错误。下面是一些常见错误及其解决方法:

1. 错误:Program 'xmllint’未找到或不可执行

解决方法:安装libxml2-utils

sudo apt-get install libxml2-utils
  • 1

2. 错误:Program 'xsltproc’未找到或不可执行

解决方法:安装xsltproc

sudo apt install -y xsltproc
  • 1

3. 错误:Run-time dependency fuse3未找到

解决方法:安装libfuse3-devlibfuse-dev

sudo apt-get install libfuse3-dev
sudo apt-get install libfuse-dev
  • 1
  • 2

4. 错误:Run-time dependency glib-2.0未找到

解决方法:安装libglib2.0-dev

sudo apt-get install libglib2.0-dev
  • 1

5. 错误:Pkg-config二进制文件未找到

解决方法:安装pkg-config

sudo apt-get install pkg-config
  • 1

6. 错误:Run-time dependency glusterfs-api未找到

解决方法:安装libglusterfs-dev

sudo apt-get install libglusterfs-dev
  • 1

7. 错误:Run-time dependency gnutls未找到

解决方法:安装libgnutls28-dev

sudo apt-get install libgnutls28-dev
  • 1

8. 错误:Run-time dependency libiscsi未找到

解决方法:安装libiscsi-dev

sudo apt-get install libiscsi-dev
  • 1

9. 错误:Run-time dependency libnbd未找到

解决方法:安装libnbd-dev

sudo apt-get install libnbd-dev
  • 1

10. 错误:Run-time dependency libnl-3.0未找到

解决方法:安装libnl-3-dev

sudo apt-get install libnl-3-dev
  • 1

11. 错误:Run-time dependency libnl-route-3.0未找到

解决方法:安装libnl-route-3-dev

sudo apt-get install libnl-route-3-dev
  • 1

12. 错误:Run-time dependency libparted未找到

解决方法:安装libparted-dev

sudo apt-get install libparted-dev
  • 1

13. 错误:Run-time dependency pcap未找到

解决方法:安装libpcap-dev

sudo apt-get install libpcap-dev
  • 1

14. 错误:Run-time dependency libssh未找到

解决方法:安装libssh-dev

sudo apt-get install libssh-dev
  • 1

15. 错误:Run-time dependency libssh2未找到

解决方法:安装libssh2-1-dev

sudo apt-get install libssh2-1-dev
  • 1

16. 错误:Run-time dependency libxml-2.0未找到

解决方法:安装libxml2-dev

sudo apt-get install libxml2-dev
  • 1

17. 错误:Run-time dependency wireshark未找到

解决方法:安装libwireshark-dev

sudo apt install libwireshark-dev
  • 1

18. 错误:Run-time dependency yajl未找到

解决方法:安装libyajl-dev

sudo apt install libyajl-dev
  • 1

19. 错误:Program xgettext未找到、Program msgfmt未找到、Program msgmerge未找到

解决方法:安装gettext工具集

sudo apt-get update
sudo apt-get install gettext
  • 1
  • 2

20. 错误:Run-time dependency numa未找到

解决方法:安装libnuma-dev

sudo apt-get install libnuma-dev
  • 1

21.docs/meson.build:176:2: ERROR: Program ‘rst2html5 rst2html5.py rst2html5-3’ not found or not executable

pip uninstall rst2html5
pip install docutils
  • 1
  • 2

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
  • 1
pip uninstall rst2html5
pip install docutils
  • 1
  • 2

23.原始记录:

https://github.com/libvirt/libvirt.git

meson.build:803:2: ERROR: Program 'xmllint' not found or not executable
sudo apt-get  install libxml2-utils

meson.build:803:2: ERROR: Program 'xsltproc' not found or not executable
sudo apt install -y xsltproc

Run-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-dev


Run-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-dev


Run-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-dev

Run-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-dev


Program 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: NO

docs/meson.build:176:2: ERROR: Program 'rst2html5 rst2html5.py rst2html5-3' not found or not executable

A full log can be found at /root/CLionProjects/libvirt/buildDir/meson-logs/meson-log.txt

pip uninstall rst2html5
pip install docutils

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/299108
推荐阅读
相关标签
  

闽ICP备14008679号