centos8构建slurm rpm包时报错:python is needed by slurm

查看是否安装python

# which python

/usr/bin/which: no python in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

# which python2

/usr/bin/python2

# which python3

/usr/bin/python3

创建软连接

# ln -s /usr/bin/python3 /usr/bin/python

解压slurm包

# tar xjvf slurm-19.05.7.tar.bz2

更改配置文件

# vim slurm-19.05.7/slurm.spec

在开头添加如下三行:

%undefine _hardened_build
%global _hardened_cflags "-Wl,-z,lazy"
%global _hardened_ldflags "-Wl,-z,lazy"

修改此处为:

BuildRequires: python3

重新打包并构建

# rm slurm-19.05.7.tar.bz2 -f

# tar cjvf slurm-19.05.7.tar.bz2 slurm-19.05.7

# rpmbuild -tb slurm-19.05.7.tar.bz2

原文地址:https://www.cnblogs.com/1016391912pm/p/15232745.html