As a normal user on OpenSUSE Tumbleweed, rspm::enable() encounters an error trying to install reqs:
rspm::enable()
#> Downloading and installing required utilities...
#> Root privileges are required to run this command.
#> Error: something went wrong, utilities not available
This appears to be due to zypper -d (= zypper --download-only) still requiring root privileges.
I expect that this problem also occurs on OpenSUSE Leap:
podman run opensuse/leap bash -c "zypper install -y sudo && useradd --create-home testuser && sudo -u testuser bash -c '(cd ~ && zypper --pkg-cache-dir /home/testuser install -dy patchelf)'"
also produces Root privileges are required to run this command. when attempting to use zypper -d.
Potential alternatives
Treat reqs as preqs instead and forcing user to get root to install them
Not as smooth as the current approach, but not too bad.
zypper --pkg-cache-dir . download <name>
There is zypper download that doesn't require root privileges. Some notes:
- nonissue?:
zypper download does not appear to automatically download dependencies, though this may not be an issue:
ldd probably already exists, at least on opensuse/{leap,tumbleweed} images from Docker Hub (and zypper install ldd would fail anyway, as it's not recognized as a package or capability name)
- Running
zypper install patchelf on the above containers appears to only install patchelf and no additional (dependency) packages, so it looks like fresh systems may already have all of its dependencies.
- (If other packages are needed, there's
zypper info --requires <name>, though its output seems pretty unfriendly; hopefully somewhere there's a better option.)
- issue: even if the rpm is successfully downloaded,
rpm_install() routes to rpm2archive, which isn't installed by default, and which zypper install can't find.
- My
rspm:::rpm_version() is '4.19.1.1'. But the ver >= "1000.0" command seems to successfully run when I manually try it. Perhaps the rpm_version logic could be adjusted to avoid this issue.
- This likely also happens on Leap: the
opensuse/leap image has an rpm --version of RPM version 4.14.3, but no rpm2archive installed, and zypper install rpm2archive doesn't find it as a package or capability.
part of `sudo zypper install patchelf` output
The following NEW package is going to be installed:
patchelf
1 new package to install.
`zypper info --requires patchelf` output
Loading repository data...
Reading installed packages...
Information for package patchelf:
---------------------------------
Repository : Main Repository (OSS)
Name : patchelf
Version : 0.18.0-3.1
Arch : x86_64
Vendor : openSUSE
Installed Size : 284.4 KiB
Installed : No
Status : not installed
Source package : patchelf-0.18.0-3.1.src
Upstream URL : https://nixos.org/patchelf.html
Summary : A utility for patching ELF binaries
Description :
PatchELF is a simple utility for modifing existing ELF executables and
libraries. It can change the dynamic loader ("ELF interpreter") of
executables and change the RPATH of executables and libraries.
Requires : [15]
libstdc++.so.6()(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libc.so.6(GLIBC_2.38)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libstdc++.so.6(CXXABI_1.3.9)(64bit)
libgcc_s.so.1(GCC_3.3.1)(64bit)
libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
libstdc++.so.6(GLIBCXX_3.4.29)(64bit)
libstdc++.so.6(GLIBCXX_3.4.9)(64bit)
libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
libstdc++.so.6(GLIBCXX_3.4.18)(64bit)
libstdc++.so.6(GLIBCXX_3.4.26)(64bit)
libstdc++.so.6(CXXABI_1.3.5)(64bit)
Further issues down the line, at least for Tumbleweed
- issue: Tumbleweed doesn't seem to actually be supported by the Posit package manager, but the only sort of feedback hinting that something may be going wrong (with
pak::pkg_install at least) seems to be a one-time "ℹ source packages are missing from packagemanager.posit.co" as it apparently routes everything to install from source instead.
options(repos) points me to https://packagemanager.posit.co/all/__linux__/opensuse20240809/latest, which points to https://packagemanager.posit.co/all/__linux__/opensuse20240809/latest/src/contrib/PACKAGES, which contains the message "Distribution with identifier 'opensuse20240809' not supported or not enabled". (As opposed to https://packagemanager.posit.co/cran/__linux__/opensuse155/latest/src/contrib/PACKAGES which is actually a package listing.)
- But for OpenSUSE Leap it seems like the
zypper download + >= "1000.0" approach might successfully work. I haven't fully tested this yet though.
As a normal user on OpenSUSE Tumbleweed,
rspm::enable()encounters an error trying to installreqs:This appears to be due to
zypper -d(=zypper --download-only) still requiring root privileges.I expect that this problem also occurs on OpenSUSE Leap:
podman run opensuse/leap bash -c "zypper install -y sudo && useradd --create-home testuser && sudo -u testuser bash -c '(cd ~ && zypper --pkg-cache-dir /home/testuser install -dy patchelf)'"also produces
Root privileges are required to run this command.when attempting to usezypper -d.Potential alternatives
Treat
reqsaspreqsinstead and forcing user to get root to install themNot as smooth as the current approach, but not too bad.
zypper --pkg-cache-dir . download <name>There is
zypper downloadthat doesn't require root privileges. Some notes:zypper downloaddoes not appear to automatically download dependencies, though this may not be an issue:lddprobably already exists, at least onopensuse/{leap,tumbleweed}images from Docker Hub (andzypper install lddwould fail anyway, as it's not recognized as a package or capability name)zypper install patchelfon the above containers appears to only installpatchelfand no additional (dependency) packages, so it looks like fresh systems may already have all of its dependencies.zypper info --requires <name>, though its output seems pretty unfriendly; hopefully somewhere there's a better option.)rpm_install()routes torpm2archive, which isn't installed by default, and whichzypper installcan't find.rspm:::rpm_version()is'4.19.1.1'. But thever >= "1000.0"command seems to successfully run when I manually try it. Perhaps therpm_versionlogic could be adjusted to avoid this issue.opensuse/leapimage has anrpm --versionofRPM version 4.14.3, but norpm2archiveinstalled, andzypper install rpm2archivedoesn't find it as a package or capability.part of `sudo zypper install patchelf` output
`zypper info --requires patchelf` output
Further issues down the line, at least for Tumbleweed
pak::pkg_installat least) seems to be a one-time "ℹ source packages are missing from packagemanager.posit.co" as it apparently routes everything to install from source instead.options(repos)points me tohttps://packagemanager.posit.co/all/__linux__/opensuse20240809/latest, which points tohttps://packagemanager.posit.co/all/__linux__/opensuse20240809/latest/src/contrib/PACKAGES, which contains the message "Distribution with identifier 'opensuse20240809' not supported or not enabled". (As opposed tohttps://packagemanager.posit.co/cran/__linux__/opensuse155/latest/src/contrib/PACKAGESwhich is actually a package listing.)zypper download+>= "1000.0"approach might successfully work. I haven't fully tested this yet though.