rdbusinstall.packages

Can't install packages in R anymore: dbus error


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!


Solution

  • Make sure that bspm is installed via sudo -- the error is indicative of it not being the case.

    The bspm docs state

    Then, you should install bspm as a system package to be able to use it as a regular user. Download the latest version from CRAN or GitHub and proceed with the installation (note sudo):

    $ sudo R CMD INSTALL bspm_[version].tar.gz
    

    The 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 of bspm in the .libPaths().