编译hadoop-2.6.0-cdh5.7.0出现错误 Variable PACK_ENG_COMMON undefined

错误信息如下:
+ . /home/rpmbuild/rpmbuild/SOURCES/packaging_functions.sh
++ '[' -z ']'
++ echo 'Variable PACK_ENG_COMMON undefined - this needs to point to the directory ec2_build/bin/pack-eng-common in the cdh4 branch of cdh'
Variable PACK_ENG_COMMON undefined - this needs to point to the directory ec2_build/bin/pack-eng-common in the cdh4 branch of cdh
++ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.LoIQkc (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.LoIQkc (%install)
 
是在%install阶段,我去查看了packaging_functions.sh脚本,发现变量$PACK_ENG_COMMON未定义,exit 1。
请问老师遇到过这个问题么,请问如何解决

wangxiaolei

赞同来自:

linux上有rpmbuild工具吗 训练营中讲解的cdh编译视频,是centos自带的rpmbuild工具。  

fish - Hadooper

赞同来自:

看了你hadoop-2.6.0-cdh5.7.0这个版本的packaging_functions.sh,跟其它版本做了下对比,你可以将其前面的这段先去掉看是否可以,这段在cdh的其它版本中是没有的,看起来是针对ec2的特殊build,而且,检查了其中的common.sh,这个文件是空的,也就是说这段脚本应该没什么作用:
if [ -z $PACK_ENG_COMMON ] ; then
    echo "Variable PACK_ENG_COMMON undefined - this needs to point to the directory ec2_build/bin/pack-eng-common in the cdh4 branch of cdh" >&2
    exit 1
fi
if [ ! -d $PACK_ENG_COMMON ] ; then
    echo "Directory '$PACK_ENG_COMMON' missing" >&2
fi

for file in common.sh ; do
[ -f $PACK_ENG_COMMON/$file ]  || exit 1
    . $PACK_ENG_COMMON/$file
done
 

fish - Hadooper

赞同来自:

需要留心的是,如果用rpmbuild进行打包,每次这个packaging_functions.sh会重新生成,所以你要是手动改了文件内容,后面再执行rpmbuild的时候,这个文件会被再覆盖掉。得想过办法避免这个问题。

张伟

赞同来自:

冼老师,又有新的问题出现了。 编译虽然通过了,生成了新的RPM。但是我安装测试了编译后的RPM包,安装RPM时出现了错误信息。 yum install ./hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64.rpm 出现下列信息: Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Examining ./hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64.rpm: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 Marking ./hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64.rpm to be installed Loading mirror speeds from cached hostfile  * base: mirror.bit.edu.cn  * epel: mirrors.neusoft.edu.cn  * extras: mirrors.tuna.tsinghua.edu.cn  * updates: mirrors.tuna.tsinghua.edu.cn Resolving Dependencies --> Running transaction check ---> Package hadoop-client.x86_64 0:2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 will be installed --> Processing Dependency: hadoop = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Processing Dependency: hadoop-hdfs = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Processing Dependency: hadoop-yarn = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Processing Dependency: hadoop-mapreduce = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Processing Dependency: hadoop-0.20-mapreduce = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Processing Dependency: hadoop-0.20-mapreduce = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6 for package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 --> Finished Dependency Resolution Error: Package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 (/hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64)            Requires: hadoop-mapreduce = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6            Available: hadoop-mapreduce-2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6.x86_64 (cloudera-cdh5)                hadoop-mapreduce = 2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6 Error: Package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 (/hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64)            Requires: hadoop = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6            Available: hadoop-2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6.x86_64 (cloudera-cdh5)                hadoop = 2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6 Error: Package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 (/hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64)            Requires: hadoop-0.20-mapreduce = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6            Available: hadoop-0.20-mapreduce-2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6.x86_64 (cloudera-cdh5)                hadoop-0.20-mapreduce = 2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6 Error: Package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 (/hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64)            Requires: hadoop-hdfs = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6            Available: hadoop-hdfs-2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6.x86_64 (cloudera-cdh5)                hadoop-hdfs = 2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6 Error: Package: hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64 (/hadoop-client-2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6.x86_64)            Requires: hadoop-yarn = 2.6.0+cdh5.7.0+1280-1.cdh5.7.0.p0.92.el6            Available: hadoop-yarn-2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6.x86_64 (cloudera-cdh5)                hadoop-yarn = 2.6.0+cdh5.7.1+1335-1.cdh5.7.1.p0.15.el6  You could try using --skip-broken to work around the problem  You could try running: rpm -Va --nofiles --nodigest   安装时提示ERROR。    

wangxiaolei

赞同来自:

用rpm安装包,是写rpm -ivh的 yum install后面跟怎么写rpm了? 若不清楚包名,可以用yum install | grep hadoop查,然后把查到的名写在yum install后面。  

wangxiaolei

赞同来自:

rpm 只能安装已经下载到本地机器上的rpm 包 安装方法为:rpm -ivh yum能在线下载并安装rpm包 安装方法是:yum install ,yum并不是一种包,而是安装包的软件

kdmcser

赞同来自:

这个问题我也遇到了,原因是某位CDH的程序员做了一个让人想问候他十八代祖宗的改动,附上他的改动: https://github.com/cloudera/cdh-package/commit/3ce357d1c7a08f723617018e9489ec1670e6bc38 你可以在问候完他十九代祖宗后,将他的改动撤销,即可通过编译。 随便说一下SOURCE里的packaging_functions.sh要改动,SOURCE/hadoop-bigtop-packaging.tar.gz tar包里面的packaging_functions.sh也要改动。

要回复问题请先登录注册