eddelbuettel / r2u

CRAN as Ubuntu Binaries

Home Page:https://eddelbuettel.github.io/r2u

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add_cranapt_jammy script: bspm config issue

robchallen opened this issue · comments

Very enthusiastic about this project thank you for making it happen.

I just used the add_cranapt_jammy.sh script on a fresh ubuntu 22.04 install (R version 4.2.1 (2022-06-23))
and encountered and issue that after script installation install.packages() is left in a non functional state.

I looked at the bspm site and I think it may be a due change in options there, or possibly a difference between
attended and unattended installations.

# after running script
install.packages("curl")
# results in "Error in install.packages : cannot connect to the system package manager"
# applying the following to fix:
options(bspm.sudo = FALSE)
install.packages("curl")
Install system packages...

I've modified the changes the script made to my /etc/R/Rprofile.set by this script to remove the line

options(bspm.sudo=TRUE)

and everything now seems to work well, so thank you. I'm not 100% sure that this is the most technically correct thing to do but bspm installation instructions no longer reference the option bspm.sudo.

The error 'cannot connect to the system package manager' is indeed from the root interaction via bspm. But I found I needed it to escalate from a basic user to being able to run installations. For example on my laptop I am the standard user and use the option to install packages as user.

But what you suggest is something @Enchufa2 also mentioned to me, and indeed, once I commented out the option I was still able to install a simple and small package. I shall try again with something bigger. So thanks for the heads-up.

And I just verified it with a package needing a system installation. It really looks like I was behind here so will update. Thanks again for the heads up.

is left in a non functional state

For completeness, I never experienced that. It simply needed sudo which, once given. made it all work just fine. But indeed maybe we do get by without it.

As explained here, this option was never required and nothing changed in that regard. Moreover, it should not be used in a desktop setting, where passwordless sudo is not supposed to be available. I believe it worked for you because you use wajig. ;-)

It definitely was required in the beginning. Also note that my default for installations (of fresh packages, on empty systems etc) is a plain install.r from littler which is really just install.packages() -- because it lets me name R packages by name. The ability to talk 'system level' has to come from somewhere and at least in the beginning that needed sudo. I guess you now talk system processes that can elevate too so we no longer need it.

wajig is "only" used on the apt side of things. It affects mostly the (daily, say) apt index refresh and upgrade which for r2u only matters for only installed packages as we are now fully over apt land.

The blame, if any, is with me as you mentioned the change to me once or twice. I may only have tested it superfically, possibly under Docker, and hence not turned it. Ergo this bug report.