I am trying to create an Amazon Linux AMI EC2 instance that I can save as my own AMI, with all of the softwares installed already so I don't have to redo all of this stuff everytime I need a new EC2 instance.
One thing I'm trying to understand is where all of my R libraries are being installed to... When I install a library, I receive the following:
[root@ip-myip] R -e "install.packages('jsonlite', repos='http://cran.rstudio.com/')"
R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('jsonlite', repos='http://cran.rstudio.com/')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/jsonlite_1.5.tar.gz'
Content type 'application/x-gzip' length 1096810 bytes (1.0 MB)
==================================================
downloaded 1.0 MB
* installing *source* package ‘jsonlite’ ...
** package ‘jsonlite’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c base64.c -o base64.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c collapse_array.c -o collapse_array.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c collapse_object.c -o collapse_object.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c collapse_pretty.c -o collapse_pretty.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c escape_chars.c -o escape_chars.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c integer64_to_na.c -o integer64_to_na.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c is_datelist.c -o is_datelist.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c is_recordlist.c -o is_recordlist.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c is_scalarlist.c -o is_scalarlist.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c modp_numtoa.c -o modp_numtoa.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c null_to_na.c -o null_to_na.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c num_to_char.c -o num_to_char.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c parse.c -o parse.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c prettify.c -o prettify.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c push_parser.c -o push_parser.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c r-base64.c -o r-base64.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c register.c -o register.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c row_collapse.c -o row_collapse.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c transpose_list.c -o transpose_list.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c validate.c -o validate.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl.c -o yajl/yajl.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_alloc.c -o yajl/yajl_alloc.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_buf.c -o yajl/yajl_buf.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_encode.c -o yajl/yajl_encode.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_gen.c -o yajl/yajl_gen.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_lex.c -o yajl/yajl_lex.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_parser.c -o yajl/yajl_parser.o
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -Iyajl/api -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c yajl/yajl_tree.c -o yajl/yajl_tree.o
ar rcs libstatyajl.a yajl/yajl.o yajl/yajl_alloc.o yajl/yajl_buf.o yajl/yajl_encode.o yajl/yajl_gen.o yajl/yajl_lex.o yajl/yajl_parser.o yajl/yajl_tree.o
gcc -m64 -std=gnu99 -shared -L/usr/lib64/R/lib -L/usr/local/lib64 -o jsonlite.so base64.o collapse_array.o collapse_object.o collapse_pretty.o escape_chars.o integer64_to_na.o is_datelist.o is_recordlist.o is_scalarlist.o modp_numtoa.o null_to_na.o num_to_char.o parse.o prettify.o push_parser.o r-base64.o register.o row_collapse.o transpose_list.o validate.o -L. -lstatyajl -L/usr/lib64/R/lib -lR
installing to /usr/lib64/R/library/jsonlite/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package ‘jsonlite’
finding HTML links ... done
base64 html
flatten html
fromJSON html
prettify html
rbind_pages html
Rd warning: /tmp/RtmpZ3IcD8/R.INSTALL21106d208413/jsonlite/man/rbind_pages.Rd:22: missing file link ‘rbind’
read_json html
serializeJSON html
stream_in html
unbox html
validate html
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (jsonlite)
Making 'packages.html' ... done
The downloaded source packages are in
‘/tmp/RtmpRRGy3s/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
>
>
So the answer seems obvious... The downloaded source packages are in ‘/tmp/RtmpRRGy3s/downloaded_packages’ Wonderful! However, when I cd into my /tmp directory, I see the following...
[root@ip-myip /]# cd tmp
[root@ip-myip tmp]# ls
hsperfdata_root rstudio-rsession Rtmp49pRek Rtmp9cGn9Z RtmpzATaBO Rtmpzmgmqv
Although similar, none of those directories match the RtmpRRGy3s from the install command. Also, all of the other folders starting with Rtmp... are empty!
I like trying to understand these types of problems, and since I'll be using this AMI over and over again, I'd really like to know where my R libraries are being installed. Any help is appreciated:
EDIT - here is my home directory on my EC2 instance:
[root@ip-myip /]# ls
bin cgroup etc lib local media opt root sbin srv tmp var
boot dev home lib64 lost+found mnt proc run selinux sys usr
and here's what's hidden in my root directory:
cd root
ls -a
. .bash_history .bash_profile .cshrc .RData .tcshrc
.. .bash_logout .bashrc .pki .ssh .viminfo