Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R 3.6.3 on Ubuntu Focal points to a non-existant sed #72

Closed
florisvdh opened this issue Aug 24, 2020 · 5 comments
Closed

R 3.6.3 on Ubuntu Focal points to a non-existant sed #72

florisvdh opened this issue Aug 24, 2020 · 5 comments

Comments

@florisvdh
Copy link

When installing R 3.6.3 for Ubuntu Focal using https://docs.rstudio.com/resources/install-r/#download-and-install-r, it appears that /opt/R/3.6.3/lib/R/bin/R at line 120 has:

## some systems have a more portable sed, e.g. /usr/xpg4/bin/sed on Solaris,
## so make sure that is used.
SED=/usr/bin/sed
export SED

However sed is in /bin, not /usr/bin, and the path had to be changed into the following, in order to let e.g. bookdown::render_book() do its job.

## some systems have a more portable sed, e.g. /usr/xpg4/bin/sed on Solaris,
## so make sure that is used.
SED=/bin/sed
export SED
@florisvdh
Copy link
Author

I must add that I'm on Linux Mint 20 (derived from Ubuntu 20.04), so not 100% sure the path to sed in Mint equals that of Ubuntu, but I'd expect so (Mint uses the Ubuntu repo).

@glin
Copy link
Contributor

glin commented Aug 24, 2020

Hi, the SED variable is auto-configured by R, and not something we've set. sed does seem to be at /usr/bin/sed on Ubuntu Focal:

$ docker run -it --rm ubuntu:focal

root@d0461c08a686:/# which sed
/usr/bin/sed

/bin/sed also exists, but it's a symlink to /usr/bin/sed:

root@d0461c08a686:/# readlink -f /bin/sed
/usr/bin/sed

I'm not familiar with Linux Mint 20, but I think recent versions of Ubuntu now have /bin/ as a symlink to /usr/bin (ref). Could you put a symlink to /bin/sed at /usr/bin/sed?

@florisvdh
Copy link
Author

Hi @glin , thanks for the help. Indeed, in the meantime I had solved it with a symlink from /usr/bin/sed to /bin/sed. BTW, renv likewise complained about tar not being in /usr/bin (same solution applied). May be Mint-specific indeed, don't know for sure.

I think this issue can be closed.

@glin glin closed this as completed Aug 24, 2020
@florisvdh
Copy link
Author

@glin I have been thinking further about this, regarding the R build.

After all, my regular R install from CRAN (from https://cloud.r-project.org) runs perfectly on Mint (also with renv), and it is the 'official' Ubuntu build (I use deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/). In the output of less $(which R), we can read:

## some systems have a more portable sed, e.g. /usr/xpg4/bin/sed on Solaris,
## so make sure that is used.
SED=/bin/sed
export SED

So for some reason this is different from the build from RStudio - and clearly the above one is Mint-proof 😉 - so that may be worth considering. Note, I did not compile R, I just installed the binary packages (r-base, r-base-dev) from named repo.

Thanks for referring to the message on Disco Dingo. This seems quite a deep change, I didn't know about, and it seems the Mint developers may not have followed this. I may look further at it (live Ubuntu desktop, Mint devs) when I find some time.

As a final note: I said I changed the path to sed in /opt/R/3.6.3/lib/R/bin/R, but eventually I also added an extra symlink to sed because the compilation of the fs package, in the R 3.6.3 builld, apparently also looked for /usr/bin/sed - which by default is not there in Mint. I don't understand why it looked there (as I had changed the path in to sed in /opt/R/3.6.3/lib/R/bin/R), given the fact that fs does not complain when compiling under regular CRAN R on my machine. So I think it also will have to do with the specific R build (which I use in a project with renv, by running env RSTUDIO_WHICH_R=/opt/R/3.6.3/bin/R rstudio projectname.Rproj &).

@florisvdh
Copy link
Author

FYI, this is followed up at Linux Mint: linuxmint/linuxmint#294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants