[Rpm-maint] [rpm-software-management/rpm] RPM 4.20.0 --root /PATH/TO/FAKEROOT Reports "Unable to change root directory: Operation not permitted" (Issue #3441)
Tomas
notifications at github.com
Tue Nov 12 14:04:28 UTC 2024
After digging into rpm's git log, I found following commit:
```
commit 9c96c5d4ca376b998be9919e70f74d0995c4df2e
Author: Panu Matilainen <pmatilai at redhat.com>
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.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3441#issuecomment-2470620344
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/3441/2470620344 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241112/04a8dec9/attachment-0001.html>
More information about the Rpm-maint
mailing list