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

Installation leaves me in interactive R session #125

Closed
Midnighter opened this issue Oct 24, 2022 · 14 comments
Closed

Installation leaves me in interactive R session #125

Midnighter opened this issue Oct 24, 2022 · 14 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@Midnighter
Copy link

I'm on an Ubuntu derivative

No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy

When I install a new R version with rig, it's stuck in an interactive R session. I then need to type "enter" to see the prompt followed by q() to quit, another "enter" to see the prompt Save workspace image? [y/n/c]:.

That doesn't seem normal. Please let me know what more information you need to debug this.

@gaborcsardi
Copy link
Member

What version of rig did you use?

@Midnighter
Copy link
Author

Installed today

RIG -- The R Installation Manager 0.5.2

@gaborcsardi
Copy link
Member

Interesting. Did you see any messages from R before this happened? Can you copy the full output here? Do you have anything in your .Rprofile that could cause this?

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Oct 24, 2022
@Midnighter
Copy link
Author

Don't have any .Rprofile on the machine, will get you the full output tomorrow.

@Midnighter
Copy link
Author

Sorry, I got lost in work for a while. Output of rig add 4.1.1:

[INFO] Running `sudo` for adding new R versions. This might need your password.
[INFO] r-4.1.1_1_amd64.deb is cached at /tmp/rig/r-4.1.1_1_amd64.deb
[INFO] Running apt-get update
[INFO] > Hit:7 http://apt.pop-os.org/proprietary jammy InRelease
[INFO] > Hit:8 http://apt.pop-os.org/release jammy InRelease
[INFO] > Hit:9 http://apt.pop-os.org/ubuntu jammy InRelease
[INFO] > Hit:11 http://apt.pop-os.org/ubuntu jammy-security InRelease
[INFO] > Hit:12 http://apt.pop-os.org/ubuntu jammy-updates InRelease
[INFO] > Hit:13 http://apt.pop-os.org/ubuntu jammy-backports InRelease
[INFO] > Reading package lists...
[INFO] Running apt install
[INFO] >
[INFO] > WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
[INFO] >
[INFO] > Reading package lists...
[INFO] > Building dependency tree...
[INFO] > Reading state information...
[INFO] > The following NEW packages will be installed:
[INFO] >   r-4.1.1
[INFO] > 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
[INFO] > Need to get 0 B/59.1 MB of archives.
[INFO] > After this operation, 87.8 MB of additional disk space will be used.
[INFO] > Get:1 /tmp/rig/r-4.1.1_1_amd64.deb r-4.1.1 amd64 1 [59.1 MB]
[INFO] > Selecting previously unselected package r-4.1.1.
[INFO] > (Reading database ... 283782 files and directories currently installed.)
[INFO] > Preparing to unpack /tmp/rig/r-4.1.1_1_amd64.deb ...
[INFO] > Unpacking r-4.1.1 (1) ...
[INFO] > Setting up r-4.1.1 (1) ...
[INFO] Adding /usr/local/bin/R-4.1.1 -> /opt/R/4.1.1/bin/R
[INFO] Setting default CRAN mirror
[INFO] Setting up RSPM
[INFO] Setting up automatic system requirements installation.
[INFO] Installing pak for R 4.1.1 (if not installed yet)
[INFO] > ARGUMENT ' -s --vanilla -e invisible()' __ignored__
[INFO] >
[INFO] >
[INFO] > R version 4.1.1 (2021-08-10) -- "Kick Things"
[INFO] > Copyright (C) 2021 The R Foundation for Statistical Computing
[INFO] > Platform: x86_64-pc-linux-gnu (64-bit)
[INFO] >
[INFO] > R is free software and comes with ABSOLUTELY NO WARRANTY.
[INFO] > You are welcome to redistribute it under certain conditions.
[INFO] > Type 'license()' or 'licence()' for distribution details.
[INFO] >
[INFO] >   Natural language support but running in an English locale
[INFO] >
[INFO] > R is a collaborative project with many contributors.
[INFO] > Type 'contributors()' for more information and
[INFO] > 'citation()' on how to cite R or R packages in publications.
[INFO] >
[INFO] > Type 'demo()' for some demos, 'help()' for on-line help, or
[INFO] > 'help.start()' for an HTML browser interface to help.
[INFO] > Type 'q()' to quit R.
[INFO] >


@gaborcsardi
Copy link
Member

Hmmm, it does not happen for me, can you run these are show me the output?

dpkg -l | grep sudo
sudo --version

Thanks!

@Midnighter
Copy link
Author

Okay, it has something to do with zsh or oh-my-zsh. When I create a bash shell and run rig add, it works as expected.

@gaborcsardi
Copy link
Member

gaborcsardi commented Oct 29, 2022

I can indeed reproduce it with oh-my-zsh.

root@27f1e394aaf1:~# su bashuser -- /opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'
[1] '4.1.3'
root@27f1e394aaf1:~# su -s /bin/sh gaborcsardi -- /opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'
[1] '4.1.3'
root@27f1e394aaf1:~# su gaborcsardi -- /opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'
ARGUMENT ' -s --vanilla -e getRversion()' __ignored__

@gaborcsardi
Copy link
Member

Even simpler:

root@27f1e394aaf1:~# bash /opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'
[1] '4.1.3'
root@27f1e394aaf1:~# zsh /opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'
ARGUMENT ' -s --vanilla -e getRversion()' __ignored__

@gaborcsardi
Copy link
Member

We could probably pass -s /bin/sh to su, that should work as long as /bin/sh is present, and it should be present. We'll do this in the next version.

@Midnighter
Copy link
Author

Awesome, glad you found the cause and solution.

@gaborcsardi
Copy link
Member

Well, thanks to the oh my zsh tip, I would have never thought of that.... and it probably should not matter, meaning that it is a bug in oh my zsh?

@Midnighter
Copy link
Author

It must be one of the plugins evaluating the command options but I wouldn't know which one. It seems like a bug to me, too.

I'm on a different system now. Have you tried the following?

zsh -c "/opt/R/4.1.3/bin/R -s --vanilla -e 'getRversion()'"

@gaborcsardi
Copy link
Member

Yeah, -c does work, I could do su -c, but the issue with that is that I'll have to pass a full command line, escaped for the shell.

It is much easier to pass the plain unescaped arguments.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants