Reputation: 21
I have tried install R in Linux operated server system. I have download latest version of R from here
Then I started to install
`./configure --prefix=$HOME/R-3.4.1 --enable-R-shlib
And I get configure error: "zlib library and headers are required".
I install and configure zlib.1.2.11 and try again but still get same error.
I couldn't solve this problem.
Upvotes: 1
Views: 14023
Reputation: 89
Note - Considering your situation and provided details, I see these possible solutions :
This require the user to have installation rights on your machine.
Open a terminal, and type this command.
sudo apt update
sudo apt install r-base
This will update your packages info and install R main package (r-base). As pointed out by @Touqeer you can install only the dependencies with this command.
sudo apt build-dep r-base
If you don't have installation rights on your machine, you can proceed with source code. Thanks to the folks at AskUbuntu for this part. Dont forget to change the package version on the following code if necessary.
wget http://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz
tar xvf R-3.4.1.tar.gz
cd R-3.4.1
./configure --prefix=$HOME/R
make && make install
This will download the required files from CRAN directly. Next it will unzip the files into a directory. After this cd
command will bring you into the created directory. Finally, you will install R with the ./configure
and the make && make install
commands.
Always check that you are in the good working directory. If the ./configure
or make && make install
commands fails, you may have dependencies problems. Basicaly, you will have to do approximatively the same procedure with the missing package and so on with his dependencies. @knb at AskUbuntu propose to change the configuration file to something like configure -- with-zlib=$HOME/zlib-1.2.11
,using the zlib dependency as example, to force a dependency path into the config file.
Keep us posted!
Upvotes: 4