xmlto is needed by 解决方法
# 1. 报错背景
在 Bigtop 环境下编译 Sqoop 1.4.7 并打 RPM 包时,经常遇到如下依赖性报错:
error: Failed build dependencies:
xmlto is needed by sqoop_3_2_0-1.4.7-2.el8.noarch
1
2
2
此问题在 Rocky Linux、CentOS Stream 8、AlmaLinux 等 RHEL8+ 系列环境中尤为常见,核心原因是系统未默认安装 xmlto 工具,而 Sqoop 打包过程中需要该依赖生成部分文档。
# 2. 典型报错日志还原
编译输出片段如下:
Download https://mirrors.huaweicloud.com/apache//sqoop/1.4.7//sqoop-1.4.7.tar.gz
> Task :sqoop-tar
Copy /opt/modules/bigtop/dl/sqoop-1.4.7.tar.gz to /opt/modules/bigtop/build/sqoop/tar/sqoop-1.4.7.tar.gz
> Task :sqoop-srpm
Copying common RPM SOURCES from: /opt/modules/bigtop/bigtop-packages/src/common/sqoop (excluding 1.4.7) to /opt/modules/bigtop/build/sqoop/rpm/SOURCES
No version-specific directory found at: /opt/modules/bigtop/bigtop-packages/src/common/sqoop/1.4.7
Wrote: /opt/modules/bigtop/build/sqoop/rpm/SRPMS/sqoop_3_2_0-1.4.7-2.el8.src.rpm
> Task :sqoop-rpm FAILED
error: Failed build dependencies:
xmlto is needed by sqoop_3_2_0-1.4.7-2.el8.noarch
Installing /opt/modules/bigtop/output/sqoop/sqoop_3_2_0-1.4.7-2.el8.src.rpm
FAILURE: Build failed with an exception.
* Where:
Script '/opt/modules/bigtop/packages.gradle' line: 545
* What went wrong:
Execution failed for task ':sqoop-rpm'.
> Process 'command 'rpmbuild'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 27s
80 actionable tasks: 80 executed
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
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
# 3. 解决思路与操作步骤
问题分析
xmlto 是一款常用的文档转换工具(XML 转 man/help/doc),Sqoop RPM 规范文件(spec)在 %prep、%build 或 %install 阶段会用到它。如未预装,则编译直接失败。
# 3.1 一步解决方案
只需在目标环境提前安装 xmlto 即可:
sudo dnf install -y xmlto
# 或在 CentOS 7/8:
sudo yum install -y xmlto
1
2
3
2
3
提示
如遇镜像问题,建议使用阿里云、华为云等国内 yum 源替换默认配置,提升依赖获取速度。
# 3.2 补充依赖项推荐
为保证大部分 RPM 构建工具链完整,建议一次性安装如下依赖,避免后续反复报错:
sudo dnf install -y xmlto asciidoc docbook2X
1
- 01
- bigtop-select 打包缺 compat 报错修复 deb07-16
- 02
- bigtop-select 打包缺 control 文件报错修复 deb07-16
- 03
- 首次编译-环境初始化 必装07-16