TT Bigdata TT Bigdata
首页
GitHub (opens new window)
JaneTTR

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 报错解决

    • Ambari 报错
      • Ambari Views

      • Ambari

        • phantomjs下载失败问题
        • 编译问题:GCC 安装与配置
        • bower CERT_HAS_EXPIRED 错误问题
        • Ambari-admin包出现bower install错误
        • Cannot run program "rpmbuild"
          • 一、报错现象
          • 二、原因分析
          • 三、解决步骤
            • 1. 检查是否已安装 rpmbuild
            • 2. 安装 rpm-build 工具包
        • Python: No such file or directory
        • Yarn解压报错EOFException排查与解决
        • Rpm-maven-plugin与shebang兼容性报错
        • Rpm-maven-plugin 最佳实践
        • Bower install拉取失败解决
        • 缺少 python3 报错解决
        • Python(>=2.6) but is not installed
        • SSL_ERROR_SYSCALL 的修复方法
      • Ambari-infra

      • Ambari-metrics

    • Bigtop 报错
  • 系统适配

  • 监控与调优

  • BUG临时处理
  • 实验室

  • 运维资料
  • 报错解决
  • Ambari 报错
  • Ambari
JaneTTR
2025-05-24
目录
一、报错现象
二、原因分析
三、解决步骤
1. 检查是否已安装 rpmbuild
2. 安装 rpm-build 工具包

Cannot run program "rpmbuild"

# 一、报错现象

在使用 mvn clean install package rpm:rpm 编译 Ambari 或其他大数据组件时,出现如下报错:

[INFO] Creating directory /opt/modules/ambari/target/rpm/ambari/SOURCES
[INFO] Creating directory /opt/modules/ambari/target/rpm/ambari/SPECS
[INFO] Creating directory /opt/modules/ambari/target/rpm/ambari/SRPMS
[INFO] Creating directory /opt/modules/ambari/target/rpm/ambari/tmp-buildroot
[INFO] Creating directory /opt/modules/ambari/target/rpm/ambari/buildroot
[INFO] Creating spec file /opt/modules/ambari/target/rpm/ambari/SPECS/ambari.spec
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Ambari Main 2.8.0.0.0:
[INFO]
[INFO] Ambari Main ........................................ FAILURE [  7.398 s]
[INFO] Apache Ambari Project POM .......................... SKIPPED
[INFO] Ambari Web ......................................... SKIPPED
[INFO] Ambari Views ....................................... SKIPPED
[INFO] Ambari Admin View .................................. SKIPPED
[INFO] ambari-utility ..................................... SKIPPED
[INFO] Ambari Server SPI .................................. SKIPPED
[INFO] Ambari Service Advisor ............................. SKIPPED
[INFO] Ambari Server ...................................... SKIPPED
[INFO] Ambari Functional Tests ............................ SKIPPED
[INFO] Ambari Agent ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.153 s (Wall Clock)
[INFO] Finished at: 2025-05-24T05:40:59Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (default-cli) on project ambari: Unable to build the RPM: Error wh
ile executing process. Cannot run program "rpmbuild" (in directory "/opt/modules/ambari/target/rpm/ambari/SPECS"): error=2, No such file or di
rectory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[root@centos5 ambari]#

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

image-20250524134731002

通常表现为 Maven 调用 rpm-maven-plugin 时,系统找不到 rpmbuild 命令,导致整个 RPM 打包流程中断。环境依赖

# 二、原因分析

常见成因

  1. rpmbuild 工具未安装:大部分最小化/精简版的 CentOS、RHEL 系统默认并未安装 RPM 构建工具。
  2. 环境变量缺失:即使已安装,但如果 rpmbuild 不在 $PATH,也会导致找不到命令。
  3. 相关依赖包缺失:如 rpm-build、rpmdevtools 等依赖未就绪,间接影响构建。

# 三、解决步骤

# 1. 检查是否已安装 rpmbuild

which rpmbuild
1

如未输出路径,表示未安装。

# 2. 安装 rpm-build 工具包

提示

针对 RHEL/CentOS 及兼容系统,直接执行:

yum install -y rpm-build
1

或(部分系统需加 rpmdevtools)

yum install -y rpm-build rpmdevtools
1
#Ambari#错误排查#RPM#源码编译
Ambari-admin包出现bower install错误
Python: No such file or directory

← Ambari-admin包出现bower install错误 Python: No such file or directory→

最近更新
01
当前版本 2026/08
08-29
02
把 Ambari Server HA 稳稳地跑起来
08-17
03
从一次启用操作追到主备就绪
08-17
更多文章>
Theme by Vdoing | Copyright © 2017-2026 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式