Open uday1kiran opened 2 years ago
To the best of my knowledge, you can't install rpms from an rpm script because yum/dnf/rpm only allow one application to control the rpm database at one time. Attempting to do so results in the error message you get, "cant' create transaction lock on ..." because access is locked. RPM tries to protect itself from concurrency bugs by requiring that only one program can install rpms at a given time.
You may find workarounds using a post-install script to schedule an at or cronjob which tries to install the extra package afterwards, but it might get complicated as weird edge cases (the job fails, etc) become frustrating to resolve.
We set python3 as dependency but it installs 3.6 version on CentOS and 3.7 on aws linux 2. But we need 3.8 to be installed, that's why we are trying above steps with before script.
Can you suggest an alternative solution?
Because python 3.8+ required for other steps to continue in the installation.
On Sat, 23 Apr, 2022, 2:00 am Jordan Sissel, @.***> wrote:
To the best of my knowledge, you can't install rpms from an rpm script because yum/dnf/rpm only allow one application to control the rpm database at one time. Attempting to do so results in the error message you get, "cant' create transaction lock on ..." because access is locked. RPM tries to protect itself from concurrency bugs by requiring that only one program can install rpms at a given time.
You may find workarounds using a post-install script to schedule an at or cronjob which tries to install the extra package afterwards, but it might get complicated as weird edge cases (the job fails, etc) become frustrating to resolve.
— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/issues/1890#issuecomment-1106835581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGXBQTDYXLZVP5V3TIILVTVGMD47ANCNFSM5UBR7VYA . You are receiving this because you authored the thread.Message ID: @.***>
I need to install python3.8 as dependency to out application rpm.
If I set that as dependency using -d python3, it is installing 3.7 version on amazon linux and 3.6 on centos 8. To use 3.8 version, there are few other steps to be performed before installing package.
So, I removed the python3 from dependency section and added in --before-install as shell script.
This is the shell script I kept there.
!/bin/bash
echo "Starting preinst"
echo "Checking OS Version"
It is triggering the script but stucking at the python installation from shell script.
Any suggestions on how to fix this?
My requirement is to install python3.8 as part of our product rpm also as a dependency.