R 及 R Studio 配置历史记录

OS: openSUSE Leap 42.2

1.打开终端-超级用户模式,输入root密码,敲回车
2.输入zypper in osc,敲回车,显示如下:

linux-j8ze:~ # zypper in osc
Loading repository data...
Reading installed dependencies ‘rlang’, ‘Rcpp’ are not available for package ‘tibble’packages...
Resolving package dependencies...                                                                                   
                                                                                                                    
The following 37 NEW packages are going to be installed:                                                            
  bsdtar build build-mkbaselibs build-mkdrpms bzr bzr-lang git-core git-gui git-web gitk mercurial mercurial-lang   
  obs-service-download_files obs-service-format_spec_file obs-service-recompress obs-service-set_version            
  obs-service-source_validator obs-service-tar_scm obs-service-verify_file osc perl-Crypt-SSLeay perl-Error         
  perl-YAML perl-YAML-LibYAML python-M2Crypto python-PyYAML python-SecretStorage python-curses python-dateutil      
  python-keyring python-packaging python-pycurl python-setuptools python-urlgrabber qemu-linux-user rpm-build       
  systemd-rpm-macros                                                                                                
                                                                                                                    
The following 18 recommended packages were automatically selected:                                                  
  bsdtar build build-mkdrpms bzr-lang mercurial-lang obs-service-download_files obs-service-format_spec_file        
  obs-service-recompress obs-service-set_version obs-service-source_validator obs-service-tar_scm                   
  obs-service-verify_file perl-Crypt-SSLeay perl-YAML perl-YAML-LibYAML python-keyring python-packaging             
  qemu-linux-user                                                                                                   
                                                                                                                    
37 new packages to install.                                                                                         
Overall download size: 18.9 MiB. Already cached: 0 B. After the operation, additional 164.0 MiB will be used.       
Continue? [y/n/? shows all options] (y): y
Retrieving package build-mkbaselibs-20160809-1.2.noarch                       (1/37),  30.9 KiB ( 34.9 KiB unpacked)
Retrieving: build-mkbaselibs-20160809-1.2.noarch.rpm .........................................................[done]
Retrieving package obs-service-recompress-0.3.1+git20160217.7897d3f-8.1.noarch
                                                                              (2/37),   6.0 KiB (  3.9 KiB unpacked)
Retrieving: obs-service-recompress-0.3.1+git20160217.7897d3f-8.1.noarch.rpm ..................................[done]
Retrieving package obs-service-set_version-0.5.3-4.1.noarch                   (3/37),  11.7 KiB ( 12.5 KiB unpacked)
Retrieving: obs-service-set_version-0.5.3-4.1.noarch.rpm .....................................................[done]
Retrieving package obs-service-verify_file-0.1.1-21.1.noarch                  (4/37),   5.6 KiB (  2.9 KiB unpacked)
Retrieving: obs-service-verify_file-0.1.1-21.1.noarch.rpm ....................................................[done]
Retrieving package perl-Error-0.17021-4.1.noarch                              (5/37),  28.3 KiB ( 49.8 KiB unpacked)
Retrieving: perl-Error-0.17021-4.1.noarch.rpm ................................................................[done]
Retrieving package perl-YAML-1.15-3.1.noarch                                  (6/37),  82.7 KiB (187.7 KiB unpacked)
Retrieving: perl-YAML-1.15-3.1.noarch.rpm ....................................................................[done]
Retrieving package python-SecretStorage-2.3.1-1.1.noarch                      (7/37),  23.8 KiB ( 71.5 KiB unpacked)
Retrieving: python-SecretStorage-2.3.1-1.1.noarch.rpm ........................................................[done]
Retrieving package python-dateutil-2.4.2-15.1.noarch                          (8/37), 216.6 KiB (443.2 KiB unpacked)
Retrieving: python-dateutil-2.4.2-15.1.noarch.rpm ............................................................[done]
Retrieving package python-packaging-15.3-5.1.noarch                           (9/37),  27.5 KiB (105.0 KiB unpacked)
Retrieving: python-packaging-15.3-5.1.noarch.rpm .............................................................[done]
Retrieving package python-setuptools-18.0.1-4.1.noarch                       (10/37), 263.9 KiB (  1.0 MiB unpacked)
Retrieving: python-setuptools-18.0.1-4.1.noarch.rpm ..........................................................[done]
Retrieving package systemd-rpm-macros-3-2.16.noarch                          (11/37),   7.6 KiB ( 12.1 KiB unpacked)
Retrieving: systemd-rpm-macros-3-2.16.noarch.rpm .............................................................[done]
Retrieving package bzr-2.6.0-8.5.x86_64                                      (12/37),   2.4 MiB ( 12.4 MiB unpacked)
Retrieving: bzr-2.6.0-8.5.x86_64.rpm .........................................................................[done]
Retrieving package perl-Crypt-SSLeay-0.72-3.4.x86_64                         (13/37),  60.1 KiB (131.7 KiB unpacked)
Retrieving: perl-Crypt-SSLeay-0.72-3.4.x86_64.rpm ............................................................[done]
Retrieving package perl-YAML-LibYAML-0.38-5.1.x86_64                         (14/37),  68.1 KiB (169.0 KiB unpacked)
Retrieving: perl-YAML-LibYAML-0.38-5.1.x86_64.rpm ............................................................[done]
Retrieving package python-PyYAML-3.11-6.3.x86_64                             (15/37), 141.6 KiB (599.9 KiB unpacked)
Retrieving: python-PyYAML-3.11-6.3.x86_64.rpm ................................................................[done]
Retrieving package python-curses-2.7.12-24.1.x86_64                          (16/37),  43.6 KiB (130.8 KiB unpacked)
Retrieving: python-curses-2.7.12-24.1.x86_64.rpm .............................................................[done]
Retrieving package python-pycurl-7.19.0-4.5.x86_64                           (17/37),  48.8 KiB (137.3 KiB unpacked)
Retrieving: python-pycurl-7.19.0-4.5.x86_64.rpm ..............................................................[done]
Retrieving package build-20160809-1.2.noarch                                (18/37), 156.1 KiB (1012.4 KiB unpacked)
Retrieving: build-20160809-1.2.noarch.rpm ....................................................................[done]
Retrieving package python-keyring-9.3.1-1.1.noarch                           (19/37),  70.4 KiB (179.9 KiB unpacked)
Retrieving: python-keyring-9.3.1-1.1.noarch.rpm ..............................................................[done]
Retrieving package rpm-build-4.11.2-10.1.x86_64                              (20/37),  33.4 KiB ( 24.6 KiB unpacked)
Retrieving: rpm-build-4.11.2-10.1.x86_64.rpm .................................................................[done]
Retrieving package bzr-lang-2.6.0-8.5.noarch                                 (21/37), 296.4 KiB (  1.7 MiB unpacked)
Retrieving: bzr-lang-2.6.0-8.5.noarch.rpm ....................................................................[done]
Retrieving package mercurial-3.8.3-1.15.x86_64                               (22/37),   2.1 MiB (  8.3 MiB unpacked)
Retrieving: mercurial-3.8.3-1.15.x86_64.rpm ..................................................................[done]
Retrieving package python-urlgrabber-3.9.1-14.3.noarch                       (23/37),  73.2 KiB (297.4 KiB unpacked)
Retrieving: python-urlgrabber-3.9.1-14.3.noarch.rpm ..........................................................[done]
Retrieving package obs-service-download_files-0.5.1.git.1455712026.9c0a4a0-7.1.noarch
                                                                             (24/37),  11.0 KiB ( 11.1 KiB unpacked)
Retrieving: obs-service-download_files-0.5.1.git.1455712026.9c0a4a0-7.1.noarch.rpm ...........................[done]
Retrieving package build-mkdrpms-20160809-1.2.noarch                         (25/37),  23.4 KiB (  4.7 KiB unpacked)
Retrieving: build-mkdrpms-20160809-1.2.noarch.rpm ............................................................[done]
Retrieving package obs-service-source_validator-0.6+git20160531.fbfe336-12.1.noarch
                                                                             (26/37),  29.6 KiB ( 61.1 KiB unpacked)
Retrieving: obs-service-source_validator-0.6+git20160531.fbfe336-12.1.noarch.rpm .............................[done]
Retrieving package mercurial-lang-3.8.3-1.15.noarch                          (27/37), 937.1 KiB (  4.7 MiB unpacked)
Retrieving: mercurial-lang-3.8.3-1.15.noarch.rpm .............................................................[done]
Retrieving package obs-service-format_spec_file-20160406-1.2.noarch          (28/37),  29.3 KiB ( 82.8 KiB unpacked)
Retrieving: obs-service-format_spec_file-20160406-1.2.noarch.rpm .............................................[done]
Retrieving package bsdtar-3.1.2-16.1.x86_64                                  (29/37),  59.0 KiB (111.9 KiB unpacked)
Retrieving: bsdtar-3.1.2-16.1.x86_64.rpm .....................................................................[done]
Retrieving package python-M2Crypto-0.22.5-8.1.x86_64                         (30/37), 194.8 KiB (988.4 KiB unpacked)
Retrieving: python-M2Crypto-0.22.5-8.1.x86_64.rpm ............................................................[done]
Retrieving package qemu-linux-user-2.6.2-26.1.x86_64                         (31/37),   6.2 MiB ( 99.0 MiB unpacked)
Retrieving: qemu-linux-user-2.6.2-26.1.x86_64.rpm ............................................................[done]
Retrieving package git-core-2.10.2-3.1.x86_64                                (32/37),   4.2 MiB ( 28.0 MiB unpacked)
Retrieving: git-core-2.10.2-3.1.x86_64.rpm .......................................................[done (1.8 MiB/s)]
Retrieving package gitk-2.10.2-3.1.x86_64                                    (33/37), 233.5 KiB (738.3 KiB unpacked)
Retrieving: gitk-2.10.2-3.1.x86_64.rpm .......................................................................[done]
Retrieving package git-web-2.10.2-3.1.x86_64                                 (34/37), 177.5 KiB (321.8 KiB unpacked)
Retrieving: git-web-2.10.2-3.1.x86_64.rpm ....................................................................[done]
Retrieving package git-gui-2.10.2-3.1.x86_64                                 (35/37), 309.9 KiB (  1.3 MiB unpacked)
Retrieving: git-gui-2.10.2-3.1.x86_64.rpm ....................................................................[done]
Retrieving package osc-0.155.0-6.1.noarch                                    (36/37), 432.3 KiB (  1.7 MiB unpacked)
Retrieving: osc-0.155.0-6.1.noarch.rpm .......................................................................[done]
Retrieving package obs-service-tar_scm-0.6.0.1469628830.67456b7-5.1.noarch   (37/37),  32.5 KiB ( 60.4 KiB unpacked)
Retrieving: obs-service-tar_scm-0.6.0.1469628830.67456b7-5.1.noarch.rpm ......................................[done]
Checking for file conflicts: .................................................................................[done]
( 1/37) Installing: build-mkbaselibs-20160809-1.2.noarch .....................................................[done]
( 2/37) Installing: obs-service-recompress-0.3.1+git20160217.7897d3f-8.1.noarch ..............................[done]
( 3/37) Installing: obs-service-set_version-0.5.3-4.1.noarch .................................................[done]
( 4/37) Installing: obs-service-verify_file-0.1.1-21.1.noarch ................................................[done]
( 5/37) Installing: perl-Error-0.17021-4.1.noarch ............................................................[done]
( 6/37) Installing: perl-YAML-1.15-3.1.noarch ................................................................[done]
( 7/37) Installing: python-SecretStorage-2.3.1-1.1.noarch ....................................................[done]
( 8/37) Installing: python-dateutil-2.4.2-15.1.noarch ........................................................[done]
( 9/37) Installing: python-packaging-15.3-5.1.noarch .........................................................[done]
(10/37) Installing: python-setuptools-18.0.1-4.1.noarch ......................................................[done]
(11/37) Installing: systemd-rpm-macros-3-2.16.noarch .........................................................[done]
(12/37) Installing: bzr-2.6.0-8.5.x86_64 .....................................................................[done]
(13/37) Installing: perl-Crypt-SSLeay-0.72-3.4.x86_64 ........................................................[done]
(14/37) Installing: perl-YAML-LibYAML-0.38-5.1.x86_64 ........................................................[done]
(15/37) Installing: python-PyYAML-3.11-6.3.x86_64 ............................................................[done]
(16/37) Installing: python-curses-2.7.12-24.1.x86_64 .........................................................[done]
(17/37) Installing: python-pycurl-7.19.0-4.5.x86_64 ..........................................................[done]
(18/37) Installing: build-20160809-1.2.noarch ................................................................[done]
(19/37) Installing: python-keyring-9.3.1-1.1.noarch ..........................................................[done]
Additional rpm output:
update-alternatives: using /usr/bin/keyring-2.7 to provide /usr/bin/keyring (keyring) in auto mode


(20/37) Installing: rpm-build-4.11.2-10.1.x86_64 .............................................................[done]
(21/37) Installing: bzr-lang-2.6.0-8.5.noarch ................................................................[done]
(22/37) Installing: mercurial-3.8.3-1.15.x86_64 ..............................................................[done]
(23/37) Installing: python-urlgrabber-3.9.1-14.3.noarch ......................................................[done]
(24/37) Installing: obs-service-download_files-0.5.1.git.1455712026.9c0a4a0-7.1.noarch .......................[done]
(25/37) Installing: build-mkdrpms-20160809-1.2.noarch ........................................................[done]
(26/37) Installing: obs-service-source_validator-0.6+git20160531.fbfe336-12.1.noarch .........................[done]
(27/37) Installing: mercurial-lang-3.8.3-1.15.noarch .........................................................[done]
(28/37) Installing: obs-service-format_spec_file-20160406-1.2.noarch .........................................[done]
(29/37) Installing: bsdtar-3.1.2-16.1.x86_64 .................................................................[done]
(30/37) Installing: python-M2Crypto-0.22.5-8.1.x86_64 ........................................................[done]
(31/37) Installing: qemu-linux-user-2.6.2-26.1.x86_64 ........................................................[done]
(32/37) Installing: git-core-2.10.2-3.1.x86_64 ...............................................................[done]
(33/37) Installing: gitk-2.10.2-3.1.x86_64 ...................................................................[done]
(34/37) Installing: git-web-2.10.2-3.1.x86_64 ................................................................[done]
(35/37) Installing: git-gui-2.10.2-3.1.x86_64 ................................................................[done]
(36/37) Installing: osc-0.155.0-6.1.noarch ...................................................................[done]
(37/37) Installing: obs-service-tar_scm-0.6.0.1469628830.67456b7-5.1.noarch ..................................[done]

3.输入zypper update R-base,敲回车,显示如下

linux-j8ze:~ # zypper update R-base
Loading repository data...
Reading installed packages...
No update candidate for 'R-base-3.3.1-5.8.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

4.输入zypper install R-patched R-patched-devel,敲回车,显示如下

linux-j8ze:~ # zypper install R-patched R-patched-devel
Retrieving repository 'USTC:42.2:UPDATE-OSS' metadata ........................................................[done]
Building repository 'USTC:42.2:UPDATE-OSS' cache .............................................................[done]
Loading repository data...
Reading installed packages...
'R-patched' not found in package names. Trying capabilities.
No provider of 'R-patched' found.
'R-patched-devel' not found in package names. Trying capabilities.
No provider of 'R-patched-devel' found.
Resolving package dependencies...

Nothing to do.

5.输入VERSION=$(grep VERSION /etc/SuSE-release | sed -e 's/VERSION = //'),敲回车
输入http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_$VERSION/ \\,敲回车,输入R-base,敲回车
显示-bash: http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_42.2/: No such file or directory

linux-j8ze:~ # VERSION=$(grep VERSION /etc/SuSE-release | sed -e 's/VERSION = //')
linux-j8ze:~ # http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_$VERSION/ \
> R-base
-bash: http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_42.2/: No such file or directory

6.输入zypper addrepo -f \\,敲回车,输入http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_$VERSION/ \R-base,敲回车,显示Adding repository 'R-base'……

linux-j8ze:~ # zypper addrepo -f \
> http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_$VERSION/ \R-base
Adding repository 'R-base' ...................................................................................[done]
Repository 'R-base' successfully added
Enabled     : Yes                                                                                  
Autorefresh : Yes                                                                                  
GPG Check   : Yes                                                                                  
Priority    : 99                                                                                   
URI         : http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_42.2/

7.输入zypper install R-base R-base-devel,敲回车,显示如下

linux-j8ze:~ # zypper install R-base R-base-devel
Retrieving repository 'R-base' metadata .....................................................................[error]
Repository 'R-base' is invalid.
[R-base|http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_42.2/] Valid metadata not found at specified URL                                                                                                
Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Skipping repository 'R-base' because of the above error.
Some of the repositories have not been refreshed because of an error.
Loading repository data...
Reading installed packages...
'R-base' is already installed.
No update candidate for 'R-base-3.3.1-5.8.x86_64'. The highest available version is already installed.
'R-base-devel' is already installed.
No update candidate for 'R-base-devel-3.3.1-5.8.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

8.输入R,敲回车

linux-j8ze:~ # R

R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-suse-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.

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.

> q()
Save workspace image? [y/n/c]: n

9.输入zypper update R-base R-base-devel,敲回车

linux-j8ze:~ # zypper update R-base R-base-devel
Retrieving repository 'R-base' metadata .....................................................................[error]
Repository 'R-base' is invalid.
[R-base|http://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_42.2/] Valid metadata not found at specified URL                                                                                                
Please check if the URIs defined for this repository are pointing to a valid repository.
Warning: Skipping repository 'R-base' because of the above error.
Some of the repositories have not been refreshed because of an error.
Loading repository data...
Reading installed packages...
No update candidate for 'R-base-3.3.1-5.8.x86_64'. The highest available version is already installed.
No update candidate for 'R-base-devel-3.3.1-5.8.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

10.输入zypper addrepo -f http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_Leap_42.1/ \R-base,敲回车

linux-j8ze:~ # zypper addrepo -f http://download.opensuse.org/repositories/devel\:/languages\:/R\:/patched/openSUSE_Leap_42.1/ \R-base           
Adding repository 'R-base' ...................................................................................[done]
Repository named 'R-base' already exists. Please use another alias.

11.在/usr/local/bin中创建R链接

linux-j8ze:~ # ln -s /usr/lib64/R/bin/R ln -s 
linux-j8ze:/usr # cd /usr/local/bin
linux-j8ze:/usr/local/bin # rm R
linux-j8ze:/usr/local/bin # ls
linux-j8ze:/usr/local/bin # ls -la
total 0
drwxr-xr-x 1 root root  0 Jan 24 13:18 .
drwxr-xr-x 1 root root 76 Jan 23 20:54 ..
linux-j8ze:/usr/local/bin # ln -s /usr/lib64/R/bin/R /usr/local/bin/R
linux-j8ze:/usr/local/bin # cd

完成后在文件管理中打开/usr/local/bin,右击文件R,选择 活动 - 在Konsole中打开,即可在命令行中运行R

12.右击rstudio-1.0.136-x86_64.rpm,选择 打开方式 - 安装/移除软件,点击接受,即可安装 R Studio

13.安装libgstreamer-0_10-0,否则打开 RStudio 报错

linux-j8ze:~ # rstudio
rstudio: error while loading shared libraries: libgstreamer-0.10.so.0: cannot open shared object file: No such file or directory

14.终端输入rstudio,打开 RStudio 图形界面

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 74,785评论 12 116
  • 公司的虚拟机上构建算法设计环境,需要安装R和R Studio Server。尝试和N种方法,最后还是选择编译安装,...
    Kevin_Su阅读 350评论 0 0
  • Python统计分析 调用RO网页链接在python里使用R:rpyO网页链接O网页链接金融领域R语言对比pyth...
    hzyido阅读 68,138评论 0 8
  • linux资料总章2.1 1.0写的不好抱歉 但是2.0已经改了很多 但是错误还是无法避免 以后资料会慢慢更新 大...
    O感悟人生O阅读 7,348评论 2 27
  • 《凤凰城的时光》 门廊,晒着一列光阴 一行竹椅打着瞌睡 凤凰城的时光 是一帧发黄的故事 故事里淌着潺潺水声 和画着...
    一片云诗阅读 75评论 6 15