fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.1k stars 110 forks source link

`junest -f pacman -S nano` fails with permission denied error on RHEL 8.1 #248

Closed penyuan closed 3 years ago

penyuan commented 4 years ago

Hello,

I am testing out Junest on a RHEL 8.1 system, and I was able to use the recommended method to install Junest and junest setup and junest -f pacman -Syy ran without errors. I started by installing the fairly simple nano via the command junest -f pacman -S nano. Unfortunately this fails with:

...
[many lines similar to below]
...
warning: warning given when extracting /usr/share/nano/tex.nanorc (Can't set user=0/group=0 for /usr/share/nano/tex.nanorc)
warning: warning given when extracting /usr/share/nano/texinfo.nanorc (Can't set user=0/group=0 for /usr/share/nano/texinfo.nanorc)
warning: warning given when extracting /usr/share/nano/xml.nanorc (Can't set user=0/group=0 for /usr/share/nano/xml.nanorc)
could not change the root directory (Operation not permitted)
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
could not change the root directory (Operation not permitted)
error: command failed to execute correctly

I can also confirm that running junest -f pacman -Syu fails with a ton of could not change the root directory (Operation not permitted) and (Can't set user=0/group=0 for [a certain file/path]) errors.

Looks like permissions problems, but I can't figure out what's wrong. Can anyone please advise? Thanks!

fsquillace commented 4 years ago

Thanks. I was able to reproduce the issue. We may need to change the way -f works.

Try the normal user and run sudo instead:

$ junest
sudo pacman -Sy nano
penyuan commented 4 years ago

Try the normal user and run sudo instead

I tried this with the same errors. I tried junest pacman -Syu to install updates, full output here.

Lots of (Can't set user=0/group=0 for [path to a file])

fsquillace commented 4 years ago

Even though it shows the message it should install the package correctly anyway: https://github.com/fsquillace/junest#cant-set-user-and-group-as-root

penyuan commented 4 years ago

Even though it shows the message it should install the package correctly anyway: https://github.com/fsquillace/junest#cant-set-user-and-group-as-root

Ah I see. After running sudo pacman -S nano, nano was indeed installed and looks usable so far. Thank you!

You did say we might need to change the way -f works earlier. How can I help with that?

fsquillace commented 4 years ago

junest ns -f uses an option from the backend bwrap to simulate fakeroot: --uid 0 source. The normal user can use sudo which is based on the combination of fakechroot fakeroot source. One way would be to make sure they both use the same behavior but it would require to see whether side effects could come from it.

penyuan commented 4 years ago

OK, well if it's every implemented I'd be happy to help test it.

fsquillace commented 3 years ago

This has been solved now. Resolving.