Cannot install R in RHEL 8.5 using a Dockerfile script - r

I can install R and RStudio with no problem from the RHEL 8.5 CLI.
However, when I try to automate the installation process using a Dockerfile following the instructions at https://docs.rstudio.com/resources/install-r-source/, I get the following error when trying to pass the value defined in my "export R_VERSION=4.0.2" instruction:
[ 6/11] **RUN yum install -y R-${R_VERSION}-1-1.x86_64.rpm --nogpgcheck**:
#9 0.957 Last metadata expiration check: 0:00:04 ago on Fri Mar 25 19:22:44 2022.
#9 1.066 Can not load RPM file: R--1-1.x86_64.rpm.
#9 1.071 Could not open: R--1-1.x86_64.rpm
executor failed running [/bin/sh -c yum install -y R-${R_VERSION}-1-1.x86_64.rpm --nogpgcheck]: exit code: 1
Help is appreciated.
sh-4.4# **yum install -y R-${R_VERSION}-1-1.x86_64.rpm --nogpgcheck**
Last metadata expiration check: 0:02:02 ago on Fri Mar 25 15:56:49 2022.
Dependencies resolved.
=============================================================================================================================================================== Package Architecture Version Repository Size
===============================================================================================================================================================Installing:
R-4.0.2 x86_64 1-1 #commandline 58 M
Upgrading:
glibc x86_64 2.28-164.el8_5.3 ubi-8-baseos 3.6 M
glibc-common x86_64 2.28-164.el8_5.3 ubi-8-baseos 1.3 M
glibc-minimal-langpack x86_64 2.28-164.el8_5.3 ubi-8-baseos 58 k
......
...........
.............
..................
**Complete!**
sh-4.4# r
sh: r: command not found
sh-4.4# /opt/R/${R_VERSION}/bin/R --version
R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

Related

How to get linux to recognize where R is located

I am sure this is a trivial question, but I am trying to install multiple R versions in Linux. I am not using R studio server pro and am instead using the free R studio server. I followed this documentation to install R but got errors when I attempted to locate it. However, when I run a command to see what version of R is installed, there is no error.
R is installed!
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ /opt/R/4.1.3/bin/R --version
R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
Attempts
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ R
Command 'R' not found, but can be installed with:
sudo apt install r-base-core
(base) noah#noah-VirtualBox:/opt/R/4.1.3$ which R
(base) noah#noah-VirtualBox:/opt/R/4.1.3$
Steps to reproduce
export R_VERSION=4.1.3
curl -O https://cran.rstudio.com/src/base/R-4/R-${R_VERSION}.tar.gz
tar -xzvf R-${R_VERSION}.tar.gz
cd R-${R_VERSION}
# Build and install R
./configure \
--prefix=/opt/R/${R_VERSION} \
--enable-memory-profiling \
--enable-R-shlib \
--with-blas \
--with-lapack
make
sudo make install
# Verify R installation
/opt/R/${R_VERSION}/bin/R --version
# Create a symlink to R
sudo ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
sudo ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
# Export path so Rstudio can find it
export RSTUDIO_WHICH_R='/opt/R/4.1.3/bin'
You are overcomplicating it. Just install in, say,
/opt/R/4.2.0/
/opt/R/4.1.2/
/opt/R/4.0.5/
and then either set the $PATH to the bin/ directory in the version you want, or call R directly. It is what pretty much exactly what many of us have done with two versions of R (i.e. R-release and R-devel):
$ R --version | head -1
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
$
$ /usr/lib/R/bin/R --version | head -1
R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
$
$ /usr/local/lib/R-devel/bin/R --version | head -1
R Under development (unstable) (2022-05-24 r82398) -- "Unsuffered Consequences"
$
The first two are the same as that is my 'default' version. The third is my one alternate. And that is all there is to it.
If you add /usr/local/bin to your $PATH variable you would have been able to launch R, if it was not already present.
You could add it to .bashrc in your home directory
echo "export path=\"${PATH}:/usr/local/bin\"" |tee -a ~/.bashrc
Links for installing R from package, Ubuntu / Debian, RHEL 9, RHEL 8, RHEL/CentOS7
https://docs.posit.co/resources/install-r/
Also see
(Optional) Install multiple versions of R, on the same page.

wkhtmltopdf 12.6 raspberry pi unpatched qt

i have the problem that my raspberry has a version of wkhtmltopdf installed that is not qt patched. But my research says that this is supposed to be fixed in version 12.6 and exactly this version I have installed.
I just installed wkhtmltopdf with apt-get install wkhtmltopdf.
What else can it be?
Here's my Linux Version:
Linux raspberrypie 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux
Here's my wkhtmltopdf Version:
wkhtmltopdf --version
wkhtmltopdf 0.12.6
Here's the output if i want to add a footer or header:
wkhtmltopdf http://google.com --footer-center 'test' Test.pdf
The switch --footer-center, is not support using unpatched qt, and will be ignored.Loading page (1/2)
Printing pages (2/2)
Done
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Cannot install latest R version on Google Cloud

I am trying to set up Rstudio on an Ubuntu cloud server (gcloud). I currently have version R-3.4.4 on RStudio, but would like to upgrade. The issue is, I am unable to.
I am running the following version of Ubuntu.
name#sc1:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
I installed the RStudio server for Ubuntu 18 as suggested here: https://www.rstudio.com/products/rstudio/download-server/debian-ubuntu/
So essentially running to install the server:
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb
sudo gdebi rstudio-server-1.4.1717-amd64.deb
Checking the version of R Studio I have:
sudo -i R
Output:
name#sc1:~$ sudo -i R
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
However, this is what pops up in my RStudio.
Anyone have ideas for what I'm doing wrong? How can I upgrade my package?
Furthermore, in my /home/user/R/x86_64-pc-linux-gnu-library directory, I have an R-3.4 folder, which is confusing…
Turns out that after I installed R 4.0, I had to restarted the VM and that seemed to work. Unclear why this is, but at least it worked!

Rust compiler not found when installing gifski

I'm trying to install gifski which is a dependency for gganimate.
I get this error.
------------------ RUST COMPILER NOT FOUND --------------------
Cargo was not found on the PATH. Please install cargo / rustc:
- yum install cargo (Fedora/CentOS)
- apt-get install cargo (Debian/Ubuntu)
- brew install rustc (MacOS)
Alternatively install Rust from: <https://www.rust-lang.org>
---------------------------------------------------------------
The yum install cargo command didn't work, so I installed Rust with
curl https://sh.rustup.rs -sSf | sh
The installation prompt said I needed to add $HOME/.cargo/bin to my path environment variable, so I tried this.
$ source $HOME/.cargo/env
$ export PATH=$PATH:$HOME/.cargo/bin
$ export PATH=$PATH:/.cargo/bin
$ export PATH=$HOME/.cargo/bin
I reset my machine and I continue to receive the same error.
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03

unable to upgrade R on aws instance of ubuntu

I'm trying up grade R (currently 3.1.3) to the latest using
sudo apt-get install r-base-dev
and get the message that I'm already on the latest:
Reading package lists... Done
Building dependency tree
Reading state information... Done
r-base-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Here is my current version
R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
So I am clearly not on the latest version.

Resources