You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I need to use command rpm --root /path/to/image/fakeroot -ivh xxx.rpm xxx.rpm as normal user to install RPM packages into my fakeroot for my embedded system.
When running with RPM 4.19.1.1, the above command runs perfectly.
However, after I upgrade my Fedora 40 to Fedora 41, RPM is also upgraded to versoin 4.20.0, the above command reports error: Unable to change root directory: Operation not permitted
To Reproduce
Steps to reproduce the behavior:
run rpm --root $(mktemp -d) -ivh your_rpm_name.rpm
as normal user
Expected behavior
rpm install the RPM package into the path specified by --root
Output
rpm reports: error: Unable to change root directory: Operation not permitted
Environment
OS / Distribution: [Fedora 41]
Version [rpm-4.20.0]
The text was updated successfully, but these errors were encountered:
After digging into rpm's git log, I found following commit:
commit 9c96c5d4ca376b998be9919e70f74d0995c4df2e
Author: Panu Matilainen <[email protected]>
Date: Fri Sep 15 14:38:35 2023 +0300
Axe the experimental non-privileged chroot support from b4c832ca
While the chroot call itself works nicely for a regular user with this,
user/group mapping does not and cannot be made to work, because that
requires a fork and we cannot very well fork the process from deep down
here.
Better to put the irrepairable thing out of its misery, users are far
better of wrapping rpm with the unshare command instead.
The log shows that I can achieve the same goal by wrapping rpm command with unshare
After experimenting, I found solution:
Use following command: unshare --mount --user --map-root-user rpm --root $(mktemp -d) -ivh your_rpm_name.rpm
You may also want to add --noplugins when running rpm in unshare environment.
Describe the bug
I need to use command
rpm --root /path/to/image/fakeroot -ivh xxx.rpm xxx.rpm
as normal user to install RPM packages into my fakeroot for my embedded system.When running with RPM 4.19.1.1, the above command runs perfectly.
However, after I upgrade my Fedora 40 to Fedora 41, RPM is also upgraded to versoin 4.20.0, the above command reports
error: Unable to change root directory: Operation not permitted
To Reproduce
Steps to reproduce the behavior:
run
rpm --root $(mktemp -d) -ivh your_rpm_name.rpm
as normal user
Expected behavior
rpm install the RPM package into the path specified by --root
Output
rpm reports:
error: Unable to change root directory: Operation not permitted
Environment
The text was updated successfully, but these errors were encountered: