rspm
rspm copied to clipboard
[OpenSUSE] zypper download command requires root
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 onopensuse/{leap,tumbleweed}
images from Docker Hub (andzypper 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 installpatchelf
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 torpm2archive
, which isn't installed by default, and whichzypper install
can't find.- My
rspm:::rpm_version()
is'4.19.1.1'
. But thever >= "1000.0"
command seems to successfully run when I manually try it. Perhaps therpm_version
logic could be adjusted to avoid this issue. - This likely also happens on Leap: the
opensuse/leap
image has anrpm --version
ofRPM version 4.14.3
, but norpm2archive
installed, andzypper install rpm2archive
doesn't find it as a package or capability.
- My
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 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/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.
-