ERROR of install packages on Linux system

Hi,
I am attempting to use commend 'install.packages("gplots")' on my Rstudio on linux system. This commend can work well on windows but it get a lot of errors on Linux. I find that if I try to install other packages I will get similar errors. I think it may because I don't know how to use Rstudio on Linux. I searched that using 'sudo' commend can solve related errors, but I can not use it because it need permission. I am trying to find other ways to solve this problem. I am a beginner of Rstudio and Linux. It will be much appreciate if anyone can give me some suggestions. Thanks!

The errors are as follows:

> install.packages("gplots")
Installing package into ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘bitops’, ‘gtools’, ‘gdata’, ‘caTools’

--2019-03-11 14:45:45--  https://cran.univ-paris1.fr/src/contrib/bitops_1.0-6.tar.gz
Resolving cran.univ-paris1.fr (cran.univ-paris1.fr)... 194.214.26.146, 2001:660:3305:144::146
Connecting to cran.univ-paris1.fr (cran.univ-paris1.fr)|194.214.26.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8734 (8,5K) [application/x-gzip]
Saving to: ‘/tmp/RtmpcMeyXZ/downloaded_packages/bitops_1.0-6.tar.gz’

     0K ........                                              100% 24,6M=0s

2019-03-11 14:45:45 (24,6 MB/s) - ‘/tmp/RtmpcMeyXZ/downloaded_packages/bitops_1.0-6.tar.gz’ saved [8734/8734]

--2019-03-11 14:45:45--  https://cran.univ-paris1.fr/src/contrib/gtools_3.8.1.tar.gz
Resolving cran.univ-paris1.fr (cran.univ-paris1.fr)... 194.214.26.146, 2001:660:3305:144::146
Connecting to cran.univ-paris1.fr (cran.univ-paris1.fr)|194.214.26.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 187516 (183K) [application/x-gzip]
Saving to: ‘/tmp/RtmpcMeyXZ/downloaded_packages/gtools_3.8.1.tar.gz’

     0K .......... .......... .......... .......... .......... 27% 1,51M 0s
    50K .......... .......... .......... .......... .......... 54% 3,74M 0s
   100K .......... .......... .......... .......... .......... 81% 10,7M 0s
   150K .......... .......... .......... ...                  100% 4,28M=0,06s

2019-03-11 14:45:45 (3,11 MB/s) - ‘/tmp/RtmpcMeyXZ/downloaded_packages/gtools_3.8.1.tar.gz’ saved [187516/187516]

--2019-03-11 14:45:45--  https://cran.univ-paris1.fr/src/contrib/gdata_2.18.0.tar.gz
Resolving cran.univ-paris1.fr (cran.univ-paris1.fr)... 194.214.26.146, 2001:660:3305:144::146
Connecting to cran.univ-paris1.fr (cran.univ-paris1.fr)|194.214.26.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1058430 (1,0M) [application/x-gzip]
Saving to: ‘/tmp/RtmpcMeyXZ/downloaded_packages/gdata_2.18.0.tar.gz’

     0K .......... .......... .......... .......... ..........  4% 2,18M 0s
    50K .......... .......... .......... .......... ..........  9% 4,59M 0s
   100K .......... .......... .......... .......... .......... 14% 10,3M 0s
   150K .......... .......... .......... .......... .......... 19% 4,73M 0s
   200K .......... .......... .......... .......... .......... 24% 20,3M 0s
   250K .......... .......... .......... .......... .......... 29% 4,18M 0s
   300K .......... .......... .......... .......... .......... 33% 12,2M 0s
   350K .......... .......... .......... .......... .......... 38% 4,59M 0s
   400K .......... .......... .......... .......... .......... 43% 3,98M 0s
   450K .......... .......... .......... .......... .......... 48% 8,78M 0s
   500K .......... .......... .......... .......... .......... 53% 4,32M 0s
   550K .......... .......... .......... .......... .......... 58% 8,79M 0s
   600K .......... .......... .......... .......... .......... 62% 4,91M 0s
   650K .......... .......... .......... .......... .......... 67% 7,20M 0s
   700K .......... .......... .......... .......... .......... 72% 9,75M 0s
   750K .......... .......... .......... .......... .......... 77% 3,98M 0s
   800K .......... .......... .......... .......... .......... 82% 5,30M 0s
   850K .......... .......... .......... .......... .......... 87% 7,58M 0s
   900K .......... .......... .......... .......... .......... 91% 9,65M 0s
   950K .......... .......... .......... .......... .......... 96% 7,36M 0s
  1000K .......... .......... .......... ...                  100% 10,4M=0,2s

2019-03-11 14:45:45 (5,74 MB/s) - ‘/tmp/RtmpcMeyXZ/downloaded_packages/gdata_2.18.0.tar.gz’ saved [1058430/1058430]

--2019-03-11 14:45:45--  https://cran.univ-paris1.fr/src/contrib/caTools_1.17.1.2.tar.gz
Resolving cran.univ-paris1.fr (cran.univ-paris1.fr)... 194.214.26.146, 2001:660:3305:144::146
Connecting to cran.univ-paris1.fr (cran.univ-paris1.fr)|194.214.26.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 63590 (62K) [application/x-gzip]
Saving to: ‘/tmp/RtmpcMeyXZ/downloaded_packages/caTools_1.17.1.2.tar.gz’

     0K .......... .......... .......... .......... .......... 80% 2,10M 0s
    50K .......... ..                                         100% 35,6M=0,02s

2019-03-11 14:45:45 (2,57 MB/s) - ‘/tmp/RtmpcMeyXZ/downloaded_packages/caTools_1.17.1.2.tar.gz’ saved [63590/63590]

--2019-03-11 14:45:45--  https://cran.univ-paris1.fr/src/contrib/gplots_3.0.1.1.tar.gz
Resolving cran.univ-paris1.fr (cran.univ-paris1.fr)... 194.214.26.146, 2001:660:3305:144::146
Connecting to cran.univ-paris1.fr (cran.univ-paris1.fr)|194.214.26.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 578652 (565K) [application/x-gzip]
Saving to: ‘/tmp/RtmpcMeyXZ/downloaded_packages/gplots_3.0.1.1.tar.gz’

     0K .......... .......... .......... .......... ..........  8% 1,34M 0s
    50K .......... .......... .......... .......... .......... 17% 2,94M 0s
   100K .......... .......... .......... .......... .......... 26% 3,60M 0s
   150K .......... .......... .......... .......... .......... 35% 3,82M 0s
   200K .......... .......... .......... .......... .......... 44% 9,52M 0s
   250K .......... .......... .......... .......... .......... 53% 4,25M 0s
   300K .......... .......... .......... .......... .......... 61% 4,03M 0s
   350K .......... .......... .......... .......... .......... 70% 3,93M 0s
   400K .......... .......... .......... .......... .......... 79% 6,03M 0s
   450K .......... .......... .......... .......... .......... 88% 3,93M 0s
   500K .......... .......... .......... .......... .......... 97% 4,02M 0s
   550K .......... .....                                      100% 29,8M=0,2s

2019-03-11 14:45:46 (3,59 MB/s) - ‘/tmp/RtmpcMeyXZ/downloaded_packages/gplots_3.0.1.1.tar.gz’ saved [578652/578652]

* installing *source* package ‘bitops’ ...
** package ‘bitops’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bit-ops.c -o bit-ops.o
In file included from bit-ops.c:1:0:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:134: recipe for target 'bit-ops.o' failed
make: *** [bit-ops.o] Error 1
ERROR: compilation failed for package ‘bitops’
* removing ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2/bitops’
Warning in install.packages :
  installation of package ‘bitops’ had non-zero exit status
* installing *source* package ‘gtools’ ...
** package ‘gtools’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c gtools_load.c -o gtools_load.o
In file included from gtools.h:1:0,
                 from gtools_load.c:1:
/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:134: recipe for target 'gtools_load.o' failed
make: *** [gtools_load.o] Error 1
ERROR: compilation failed for package ‘gtools’
* removing ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2/gtools’
Warning in install.packages :
  installation of package ‘gtools’ had non-zero exit status
ERROR: dependency ‘gtools’ is not available for package ‘gdata’
* removing ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2/gdata’
Warning in install.packages :
  installation of package ‘gdata’ had non-zero exit status
ERROR: dependency ‘bitops’ is not available for package ‘caTools’
* removing ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2/caTools’
Warning in install.packages :
  installation of package ‘caTools’ had non-zero exit status
ERROR: dependencies ‘gtools’, ‘gdata’, ‘caTools’ are not available for package ‘gplots’
* removing ‘/home/xiaofang.lou/R/x86_64-pc-linux-gnu-library/3.2/gplots’
Warning in install.packages :
  installation of package ‘gplots’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpcMeyXZ/downloaded_packages’

The key error message:

/usr/share/R/include/R.h:28:20: fatal error: stdlib.h: No such file or directory
compilation terminated.

indicates a problem with your base R installation. Current versions do not require stdlib.h, in fact references to it are commented out for editing to allow compilation of packages only in the case of legacy systems like Solaris.

My suggestion would be a fresh install of R, for which you will probably need the help of a system administrator since you lack root ("sudo") permission.

Thank you very much. I will try to fresh install of R.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.