Can't install packages on MX linux

Hello everyone

I've been using Rstudio for a few years on windows for my studies
Recently, I've decided to try MX Linux as a dual boot, and I've been facing an issue that I don't have on my windows session : when trying to install packages (that i know exist), it does download (or at least all the process in the console), but always ends in "non-zero exit status", and looking at it, it seems as though the dependencies don't download correctly either (also "non-zero exit status").
I've tried to change the cran repos, but it still won't work and I don't have any idea why.
I'd rather like to be able to do all my work on Linux, so any help would be appreciated.

Hi @oshashera, welcome to the community!

I wonder if something like this is your issue...do you have all of the development packages for R installed?

Best,
Randy

Hi @randyzwitch
Thanks for your quick answer!
Unfortunately, all of those dependencies (libcurl, r based dev, libssl-dev, libxml2-dev and g++) are already installed and up-to-date !
I already tried those a few days back if I recall correctly.
Anyway, it doesn't seem like the problem stems from this.
Any other suggestions are welcomed !

Best,
Oshashera

The only other thing I can think of is that CRAN/R install.packages doesn't know that MX Linux is a Debian-based distro. But I don't know where you'd fix that.

Have you tried downloading a known package and seeing if it will install? Not sure what package that might be that doesn't have a ton of dependencies, but if you try and get further than you did before, it might prove out what I'm saying (that it doesn't know it's Debian).

Best,
Randy

I mean, ggplot2 installed without any issues so i guess it could be that.
But I'm not really that tech-savy, I'm on linux not because of my skills, but because of my convictions, so I don't really know how I should solve this.

Thanks for you answer!

1 Like

Have you tried using https://pak.r-lib.org/ or Introduction to renv • renv? Just spitballing here :joy:

Didn't know that existed, I'll give it a try!

I tried with pak, here's what I've got :

> pak::pkg_install("RVAideMemoire")
✔ Updated metadata database: 1.68 MB in 8 files.                          
✔ Updating metadata database ... done                                     
Error:                                                                       
! error in pak subprocess
Caused by error: 
! Could not solve package dependencies:
* RVAideMemoire: Can't install dependency car
* car: Can't install dependency quantreg
* quantreg: Can't install dependency MatrixModels
* MatrixModels: Can't install dependency Matrix (>= 1.6-0)
* Matrix: Needs R >= 4.4.0
* Matrix: Needs R >= 4.5
Type .Last.error to see the more details.
> .Last.error
<callr_error/rlib_error_3_0/rlib_error/error>
Error: 
! error in pak subprocess
Caused by error: 
! Could not solve package dependencies:
* RVAideMemoire: Can't install dependency car
* car: Can't install dependency quantreg
* quantreg: Can't install dependency MatrixModels
* MatrixModels: Can't install dependency Matrix (>= 1.6-0)
* Matrix: Needs R >= 4.4.0
* Matrix: Needs R >= 4.5
---
Backtrace:
1. pak::pkg_install("RVAideMemoire")
2. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), …
3. err$throw(res$error)
---
Subprocess backtrace:
1. base::withCallingHandlers(cli_message = function(msg) { …
2. get("pkg_install_make_plan", asNamespace("pak"))(...)
3. prop$stop_for_solution_error()
4. private$plan$stop_for_solve_error()
5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
7. | base::signalCondition(cond)
8. global (function (e) …
There were 11 warnings (use warnings() to see them)

Seems like the R version i have (4.2.2) is not recent enough, but it was the one i got with apt get install like 2 weeks before today so idk

alright so it was because the R version in the Debian repos is not up to date to the preriquisite of certains dependencies.
Since Debian is not on a rolling-release model, i had to change it so that it used the cran repositories to update R on to the last available version, then restart the r session in rstudio and then it worked!

Thanks for the help provided!

1 Like

Awesome, glad you got it figured out!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.