-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve centos_install()
failing to change root dir for non-root via dnf system call
#10
solve centos_install()
failing to change root dir for non-root via dnf system call
#10
Conversation
centos_install()
fails to change root dir for non-root via dnf system callcentos_install()
failing to change root dir for non-root via dnf system call
r$> remotes::install_github("spectral-cockpit/rspm", ref = "fix/centos-non-root", force = TRUE) This seems to bootstrap missing r$> library("rspm")
enable()
Downloading and installing required utilities...
Not root, Subscription Management repositories not updated
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 10:57:24 ago on Sa 19 Nov 2022 11:59:47 CET.
patchelf-0.12-1.el8.x86_64.rpm 1.8 MB/s | 88 kB 00:00
391 blocks
Tracing function "install.packages" in package "utils"
Tracing function "update.packages" in package "utils r$> library(rspm)
r$> sessioninfo::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.2.1 (2022-06-23)
os Rocky Linux 8.7 (Green Obsidian)
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Zurich
date 2022-11-19
pandoc NA
─ Packages ────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
cli 3.4.1 2022-09-23 [1] CRAN (R 4.2.1)
rspm * 0.2.2 2022-11-19 [1] Github (spectral-cockpit/rspm@04c6467)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.1)
[1] /home/spectral-cockpit/R/x86_64-pc-linux-gnu-library/4.2
[2] /opt/R/4.2.1/lib/R/library Happy to see the workaround gives the desired result, but maybe you have a safer 🪂 in review of my draft. r$> library("magick")
Error in library("magick") : there is no package called ‘magick’
r$> rspm::enable()
Tracing function "install.packages" in package "utils"
Tracing function "update.packages" in package "utils"
r$> install.packages("magick")
Installing package into ‘/home/spectral-cockpit/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.rstudio.com/all/__linux__/centos8/latest/src/contrib/magick_2.7.3.tar.gz'
Content type 'binary/octet-stream' length 9216733 bytes (8.8 MB)
==================================================
downloaded 8.8 MB
* installing *binary* package ‘magick’ ...
* DONE (magick)
The downloaded source packages are in
‘/tmp/RtmpBC6K8f/downloaded_packages’
Inspecting installed packages...
Downloading and installing sysreqs...
Not root, Subscription Management repositories not updated
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 11:07:18 ago on Sa 19 Nov 2022 11:59:47 CET.
(1/7): ilmbase-2.2.0-13.el8.x86_64.rpm 2.1 MB/s | 113 kB 00:00
(2/7): libwmf-lite-0.2.9-8.el8_0.x86_64.rpm 1.3 MB/s | 75 kB 00:00
(3/7): libraqm-0.7.0-4.el8.x86_64.rpm 1.3 MB/s | 19 kB 00:00
(4/7): ImageMagick-c++-6.9.12.64-1.el8.x86_64.rpm 14 MB/s | 198 kB 00:00
(5/7): ImageMagick-libs-6.9.12.64-1.el8.x86_64.rpm 22 MB/s | 2.4 MB 00:00
(6/7): OpenEXR-libs-2.2.0-12.el8.x86_64.rpm 28 MB/s | 671 kB 00:00
(7/7): LibRaw-0.19.5-3.el8.x86_64.rpm 4.7 MB/s | 315 kB 00:00
1088 blocks
1350 blocks
16117 blocks
51 blocks
3925 blocks
307 blocks
6427 blocks
Configuring sysreqs... Love how clever rspm is, which makes it work without even restarting. r$> library("magick")
Linking to ImageMagick 6.9.12.50
Enabled features: cairo, fontconfig, freetype, ghostscript, lcms, pango, raw, rsvg, webp, x11
Disabled features: fftw, heic
Using 8 threads
r$> sessioninfo::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.2.1 (2022-06-23)
os Rocky Linux 8.7 (Green Obsidian)
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Zurich
date 2022-11-19
pandoc NA
─ Packages ────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
cli 3.4.1 2022-09-23 [1] CRAN (R 4.2.1)
magick * 2.7.3 2021-08-18 [1] RSPM (R 4.2.0)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.1)
Rcpp 1.0.9 2022-07-08 [1] RSPM (R 4.2.0)
rspm * 0.2.2 2022-11-19 [1] Github (spectral-cockpit/rspm@04c6467)
sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.1)
[1] /home/spectral-cockpit/R/x86_64-pc-linux-gnu-library/4.2
[2] /opt/R/4.2.1/lib/R/library
─────────────────────────────────────────────────────────────────────────────────────────────────────── To quickly test the checking of additional non-root requirements in sudo dnf remove cpio Then, in R # no warning as expected because "patchelf" and "ldd" system libraries are still available
r$> rspm::enable()
Tracing function "install.packages" in package "utils"
Tracing function "update.packages" in package "utils Remove {magick} and trying to reinstal it triggers informative error. r$> remove.packages("magick")
Removing package from ‘/home/spectral-cockpit/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
r$> library("magick")
Error in library("magick") : there is no package called ‘magick’
r$> rspm::install("magick")
Error: 'install' is not an exported object from 'namespace:rspm'
r$> install.packages("magick")
Installing package into ‘/home/spectral-cockpit/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.rstudio.com/all/__linux__/centos8/latest/src/contrib/magick_2.7.3.tar.gz'
Content type 'binary/octet-stream' length 9216733 bytes (8.8 MB)
==================================================
downloaded 8.8 MB
* installing *binary* package ‘magick’ ...
* DONE (magick)
The downloaded source packages are in
‘/tmp/RtmpX7nVE3/downloaded_packages’
Inspecting installed packages...
Downloading and installing sysreqs...
Not root, Subscription Management repositories not updated
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 11:19:53 ago on Sa 19 Nov 2022 11:59:47 CET.
(1/7): libraqm-0.7.0-4.el8.x86_64.rpm 428 kB/s | 19 kB 00:00
(2/7): ImageMagick-c++-6.9.12.64-1.el8.x86_64.rpm 3.6 MB/s | 198 kB 00:00
(3/7): OpenEXR-libs-2.2.0-12.el8.x86_64.rpm 9.5 MB/s | 671 kB 00:00
(4/7): ilmbase-2.2.0-13.el8.x86_64.rpm 4.0 MB/s | 113 kB 00:00
(5/7): libwmf-lite-0.2.9-8.el8_0.x86_64.rpm 7.0 MB/s | 75 kB 00:00
(6/7): ImageMagick-libs-6.9.12.64-1.el8.x86_64.rpm 47 MB/s | 2.4 MB 00:00
(7/7): LibRaw-0.19.5-3.el8.x86_64.rpm 6.8 MB/s | 315 kB 00:00
Error: Non-root requires 'rpm2cpio' and 'cpio' tools to unpack and copy RPM packages into home directory without admin (sudo) rights.Quit current R session. Then install missing in shell with
`sudo dnf install cpio`.
Restart R and run `rspm::enable()` again to proceed.
r$> Seems to work fine for me, except that the linked system deps for {magick}/ImageMagic still exist in the local shared library.
|
Looking forward to get your feedback. :-) If the approach is sensible enough, there is probably a little bit more to be done downstream. Happy to try help with that and get your review for that. Cheers, Philipp |
Thanks, I'll investigate this further to try to reproduce it in a Rocky Linux environment. I'd like to solve it via the rpm command exclusively to avoid depending on more tools, because rpm is always available, but rpm2cpio and cpio may not. |
Please try adding |
Closing in favor of #11. |
Dear @Enchufa2 ,
First of all thanks a lot for offering a solution for binary installs with convoluted system deps in CentOS/RHEL(-alike) distros, closing a considerable gap around RSPM/bspm/renv. Really like the design and the clarity of how interfaces are coded! So it it was straight-forward to dig in deeper.
In the current version in main, when invoking
rspm::enable()
, I got the error tracing back to the rpm install command viasystem()
.This is the current setup:
There seems to be no permission issue as outlined as possible reason for the same underlying message in #9 .
It looks like the flag
--root
(-r
) fordnf
cmd is not working unless being root. At least for my rocky 8.7 miniserver. To be honest, I don't have enough knowledge of the inner mechanistics of .RPM and the dnf tool. Could be a bug ( https://bugzilla.redhat.com/show_bug.cgi?id=1963151 ) or actually just by design because some other root directories are touched (maybe it looks for rpmdb etc.). The--prefix
trick did also not work, probably for similar reasons.I found a workaround via extracting and copying the .RPM archive to the user directory of rspm, via
rpm2cpio
and stdin intocpio
. Found this strategy on stackoverflow (e.g., https://superuser.com/questions/209808/how-can-i-install-an-rpm-without-being-root ) and here : https://scicomp.ethz.ch/wiki/Unpacking_RPM_packages .