Suddenly, I can’t install any more packages in R using install.packages
. For any package I want to install (including random characters), I get the following error message:
> install.packages('tensorA')
Error in install.packages : dbus: Call failed: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/dbus/service.py", line 658, in _message_cb (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name) File "/usr/lib/python3/dist-packages/dbus/service.py", line 248, in _method_lookup raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface))dbus.exceptions.UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: available is not a valid method of interface org.r_project.linux1.PackageManager
That’s my session info:
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3; LAPACK version 3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Berlin
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices datasets utils methods
[7] base
loaded via a namespace (and not attached):
[1] compiler_4.3.2 cli_3.6.1 tools_4.3.2 rstudioapi_0.14
[5] bspm_0.5.1 rlang_1.1.0
Any tip appreciated!
2
Answers
The operation is trying to contact the
bspm
service (which appears to be a helper service that uses the OS package manager – dnf, apt, pacman etc. – to install R packages). This happens to be done via D-Bus, but the error message is not actually related to D-Bus; it comes frombspm
itself.The message says that R attempted to call the
available()
function, which doesn’t exist in the service. According to Git commit logs, this function was added in version 0.3.10.1 of bspm.Use
busctl status org.r_project.linux1.PackageManager
(with or without--user
, I’m not sure) to find the process (PID and command line) that currently provides this service. It’s likely that bspm was upgraded but an old version is still running; kill the process and let it restart automatically.(It’s also possible that you somehow have two versions of bspm – R is trying to use 0.5.1 which expects the
available()
method to be available, but D-Bus is set up to automatically start a much older version.)Make sure that
bspm
is installed viasudo
— the error is indicative of it not being the case.The
bspm
docs stateThe error message is a little confusing, and can happen if you say, upgrade
bspm
via a normal installation and thereby ‘drop’ the system level aspect.You can also call the helper function
bspm::shadowed_packages()
to see if you accidentally installed a second copy ofbspm
in the.libPaths()
.