package installtion issue , rpm spec file , which include yum to install dependence

▼魔方 西西 提交于 2020-01-03 02:25:12

问题


im having this part of spec file ,

%post
%{__mv} %{_sysconfdir}/sysconfig/data.py /opt/data.py
%{__mv} %{_sysconfdir}/sysconfig/get-pip.py /opt/get-pip.py



yum -y install python-psycopg2
python /opt/get-pip.py
pip install setuptools --no-use-wheel --upgrade
pip install requests


echo -e "*/5 * * * * /usr/bin/python  /opt/data.py"  >> /var/spool/cron/root

%files
%{_sysconfdir}/sysconfig/data.py
%{_sysconfdir}/sysconfig/get-pip.py

%changelog

the rpmbuild without error , but when i try to install the package its stuck , i've doubt about dependence installation , im using yum am i right or there is different way to to yum here


回答1:


I believe it stuck because you are trying to run multiple YUM/RPM processes (Your package and python-psycopg2). However, you should not run yum or rpm within you rpm, but declare python-psycopg2 as a dependency, so YUM will install it before installing your RPM.




回答2:


Just put the package in Requires in your rpm spec ex:-

Requires: python-psycopg2



来源:https://stackoverflow.com/questions/20989908/package-installtion-issue-rpm-spec-file-which-include-yum-to-install-depende

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!