I have R in 3.6.3 version and I want to download 4.0.0 version. I downloaded from https://cran.r-project.org/src/base/R-4/ tar gz file but I have no idea how can I install it. Could you please give me a command which can install this R version from tar gz file ?
Install R from Source on Linux
You can find a detailed description for a range of different Linux systems here.
In short, you will need to run the following chain of commands:
First to install dependencies. This will depend on your Linux distribution. For Linux Mint, you can do
sudo apt-get build-dep r-base
Then, specify your desired R version
export R_VERSION=4.2.1
In a folder of your choice, download the .tar.gz (For versions other than 4.X, you may need to adjust the link)
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}
To build and install, run from the same shell
./configure \
--prefix=/opt/R/${R_VERSION} \
--enable-memory-profiling \
--enable-R-shlib \
--with-blas \
--with-lapack
make
sudo make install
In case the ./configure ... step does not work out, you may need to install the missing binaries individually by hand.
You can check the installation by running
/opt/R/${R_VERSION}/bin/R --version
and create a symlink
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
Done!
Your R installation will be in
/opt/R/${R_VERSION}
Related
I need to install this specific python version, to prepare a developer environment, because I'm maintaining a system with multiple libraries based on python 3.6.9.
I recently installed Ubuntu 22.04 on my laptop, but I had no success trying to install this python version.
I tried to install with apt-get after adding the deadsneak repository, but this python version is not available.
I tried installing from source by compiling, but it did not work. Running sudo make altinstall exited with this error:
Segmentation fault (core dumped)
make: *** [Makefile:1112: altinstall] Erro 139
I have faced the same problems and could make it work by adding some additional flags when running ./configure
Here are my steps:
Step 1 – Prerequsities
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev \
libgdbm-dev libnss3-dev libedit-dev libc6-dev
Step 2 – Download Python 3.6
wget https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz
tar -xzf Python-3.6.15.tgz
Step 3 – Compile Python Source
cd Python-3.6.15
./configure --enable-optimizations -with-lto --with-pydebug
make -j 8 # adjust for number of your CPU cores
sudo make altinstall
Step 4 – Check the Python Version
python3.6 -V
If you need it to install with pyenv, you could try this one:
$ sudo apt install clang -y
$ CC=clang pyenv install 3.6.9
I am new to dockers/containers.
I am trying to run a fork with a fix I have put in for openSSL vulnerability of mup-frontend using the following command:
docker build ./
It compiles to a point then errors with
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
I am running a mac so installed zlib with brew. I have searched long and hard but cannot find much on this error.
Because of this error it also fails to build on automation in docker.io
The Dockerfile you reference at
https://github.com/meteorhacks/mup-frontend-server/blob/master/Dockerfile
starts with
FROM debian
so you will need to have such a line in your Dockerfile, before the place where you need zlib
RUN apt-get update && apt-get install -y \
zlib \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
in one RUN, you update, install and clean
yum install -y httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel
Download required packages
cd
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz
wget http://zlib.net/zlib-1.2.5.tar.gz
wget ftp://ftp.openssl.org/source/openssl-0.9.8o.tar.gz
Now you have to untar these files.
tar -xvf zlib-1.2.5.tar.gz
tar -xvf pcre-8.10.tar.gz
tar -xvf openssl-0.9.8o.tar.gz
I'm having trouble trying to install R 3.0.2 in Ubuntu 16.04. I tried adding the repositories of older versions of R but the package for R 3.0.2 cannot be found in apt-get. Has anyone tried installing an older version of R on a newer version of Ubuntu? May I know what the steps are?
I tried also specifying the version in the apt-get install command but it didn't find the right package.
I see the best option in your case is to compile R. If you have never done such a thing, follow this little script in terminal:
# install common R dependencies
sudo apt-get install gcc \
g++ \
gfortran \
bzip2 \
libbz2-dev \
xorg-dev \
liblzma-dev \
libreadline-dev \
libpcre++-dev \
libcurl-dev \
libpango1.0-dev
mkdir R_alternatives
cd R_alternatives
mkdir src
mkdir 3.0.2
cd src
wget https://cran.r-project.org/src/base/R-3/R-3.0.2.tar.gz
tar -xvf R-3.0.2.tar.gz
cd R-3.0.2
#In my opinion is better to compile in one folder (avoid uncompress tar.gz source again, if you get any errors)
mkdir BuildDir
cd BuildDir
# this step will take around 2 minutes
./../configure --with-readline=no --with-x=no --prefix=/home/'user'/R_alternatives/3.0.2
# These two will take longer!!
make
make install
# following the prefix in 'configure' your R libraries are going to be installed in /home/'user'/R_alternatives/3.0.2/lib64/R/library/
# Hence, each time you compile a new R version, it will have its own libraries (this avoid R packages versions problems)
# If you wish more than one library version for the same R version, you must create a new folder and then run
export R_LIBS=/'path_to_your_new_folder'
# If you plan to use this R version in RStudio, you have to edit ~/.bash_profile, therefore you must run:
vi ~/.bash_profile
#or, It is up to you!
gedit ~/.bash_profile
#Then you put this line in end of the file
PATH=/home/'user'/R_alternatives/3.0.2/bin:$PATH
export PATH
# OR...
RSTUDIO_WHICH_R=/home/'user'/R_alternatives/3.0.2/bin/R
export RSTUDIO_WHICH_R
#PS: You can also set the R_LIBS here, in the same way!
First off, see here for a similar & older question on SO.
Pre-compiled binaries of older R releases for various Ubuntu versions (mostly the LTS releases) are available as deb's from the following website:
https://cran.r-project.org/bin/linux/ubuntu/
Unfortunately, there doesn't seem to exist a R 3.0.2 deb package for xenial; only precise still has the R 3.0.2 package. You could try to install the precise package in xenial, but that may come with its own problem set.
Might be best to compile from source following Facottons advice.
Having spent around a week trying to install R and rmr2 on AWS-EMR, I am turning to you all for a little help. My bootstrap script is successfully installing R 2.14.1-1~lennycran.0 (thanks to JD Long's blog). When I am trying to install rmr2 I am having the classic dependency problem. Seems I have to install packages like Rcpp, RJSONIO, bitops, digest and 5 more. Because only an older Rcpp works with R 2.14.1, I am downloading a named version and installing it. How old, I don't know - I randomly tried a few versions and 0.8.9 worked. I will make a few more hit-and-trials.
sudo curl -o Rcpp.tar.gz http://cran.us.r-project.org/src/contrib/Archive/Rcpp/Rcpp_0.8.9.tar.gz
sudo R CMD INSTALL Rcpp.tar.gz
Now I am supposed to install the rest of the dependencies (How?)
And eventually rmr2 would be installed. I am using the following script, which, of course fails -
sudo wget --no-check-certificate -o rmr2.tar.qz -S -T 10 -t 5 http://goo.gl/dvBric
sudo R CMD INSTALL rmr2.tar.gz
My question is -
What should be a simple bootstrap script for installing the rest of the dependencies ("RJSONIO", "bitops", "digest", "functional", "stringr", "plyr", "reshape2", "caTools")? Do I have to worry about compatibility of those packages as well?
Here is my complete bootstrap.sh code -
#!/bin/bash
#debian R upgrade
gpg --keyserver pgpkeys.mit.edu --recv-key 06F90DE5381BA480
gpg -a --export 06F90DE5381BA480 | sudo apt-key add -
echo "deb http://streaming.stat.iastate.edu/CRAN/bin/linux/debian lenny-cran/" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -t lenny-cran install --yes --force-yes r-base r-base-dev
sudo curl -o rmr2.tar.gz http://goo.gl/dvBric
sudo R CMD INSTALL rmr2.tar.gz <<<< Does not go beyond this.
set -e
bucket=muxxx-bisxxx-bucket
path=input.tar.gz
wget -S -T 10 -t 5 http://$bucket.s3.amazonaws.com/$path
mkdir -p /home/hadoop/contents
tar -C /home/hadoop/contents -xzf input.tar.gz
export HADOOP_CMD=/home/hadoop/bin/hadoop
export HADOOP_STREAMING=/home/hadoop/contrib/streaming/hadoop_streaming.jar
/home/hadoop/bin/hadoop fs -mkdir /home/hadoop/contents
/home/hadoop/bin/hadoop fs -put /home/hadoop/contents/* /home/hadoop/contents/
I have not resolved my problem on hand but I got a direction. I added the following line of code in the bootstrap script after R 2.14.1 installation and before rmr2 installation -
sudo Rscript -e 'install.packages(c("rJava", "Rcpp", "RJSONIO", "bitops", "digest", "functional", "stringr", "plyr", "reshape2", "caTools"), repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/")'
Currently the bootstrapping process breaks down at plyr, which I guess, is due to older version of Rcpp that I have.
I am closing this post.
I have a C program and I want to buid it into deb file to install it. Can you show me how to do it? Thanks so much for helping.
This guide demonstrates how to create a debian package
https://wiki.debian.org/HowToPackageForDebian
Generate a gpg key. Remember the NAME and the EMAIL_ADDRESS you enter.
gpg --gen-key
gpg -a --output ~/.gnupg/ANY_NAME.gpg --export 'YOUR NAME'
gpg --import ~/.gnupg/ANY_NAME.gpg
Then, having installed the necessary packages for building C libraries:
sudo apt-get install build-essential autoconf automake \
autotools-dev dh-make debhelper devscripts fakeroot \
xutils lintian pbuilder pkg-config
move to your C project folder. And run: (enter -s for single binary pkg when prompted )
dh_make -e EMAIL_ADDRESS -f path/to/file.orig.tar.gz
You will see a debian folder with generated files. From those,you should edit as your pkg needs the files control, copyright and changelog files.
Then build the package:
dpkg-buildpackage -rfakeroot
If no errors the package .deb is generated.
Further guides on how to do this here:
- https://askubuntu.com/questions/1345/what-is-the-simplest-debian-packaging-guide
- https://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository
- https://coderwall.com/p/urkybq/how-to-create-debian-package-from-source