无法卸载并重新安装R on centos

时间:2014-07-05 17:45:24

标签: linux r centos

我正在尝试在centos中卸载R.我试过了

sudo rpm -e R.x86_64
>error: %preun(R-2.13.0-2.el6.rf.x86_64) scriptlet failed, exit status 1

sudo yum remove R
>Failed:
  R.x86_64 0:2.13.0-2.el6.rf 

R
>R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 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.

当我尝试使用yum和rpm时,我无法卸载R失败,稍后当我再次尝试R时,它会像上面那样运行R.请帮助如何在centos中卸载R.

我已经删除了R目录,因为R执行不起作用,但重新安装R也无法正常工作。我必须重新安装R以安装一些之前没有工作的软件包,请找到以下步骤:

$sudo rm -rf /usr/lib64/R ** deleted the R directory


$sudo rpm -ivh http://mirror.chpc.utah.edu/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm


$sudo yum  -y  –enablerepo=epel  install  R  R-devel
>Loaded plugins: fastestmirror, refresh-packagekit, security

$sudo yum  install RLoaded plugins: fastestmirror, refresh-packagekit, security
>Loading mirror speeds from cached hostfile
epel/metalink                                            | 5.3 kB     00:00     
 * base: centos.aol.in
 * epel: mirror-fpt-telecom.fpt.net
 * extras: centos.aol.in
 * rpmforge: mirror-fpt-telecom.fpt.net
 * updates: centosmirror.go4hosting.in
Cloudera-cdh4                                            |  951 B     00:00     
base                                                     | 3.7 kB     00:00     
cloudera-impala                                          |  951 B     00:00     
extras                                                   | 3.4 kB     00:00     
rpmforge                                                 | 1.9 kB     00:00     
updates                                                  | 3.4 kB     00:00     
Setting up Install Process
Package R-3.1.0-5.el6.x86_64 already installed and latest version
Nothing to do

$R
>/usr/bin/R: line 236: /usr/lib64/R/etc/ldpaths: No such file or directory

$ rpm -q --scripts R
postinstall scriptlet (using /bin/sh):
/sbin/install-info /usr/share/info/R-FAQ.info.gz /usr/share/info/dir 2>/dev/null
/sbin/install-info /usr/share/info/R-admin.info.gz /usr/share/info/dir 2>/dev/null
/sbin/install-info /usr/share/info/R-exts.info.gz /usr/share/info/dir 2>/dev/null
/sbin/install-info /usr/share/info/R-intro.info.gz /usr/share/info/dir 2>/dev/null
/sbin/install-info /usr/share/info/R-lang.info.gz /usr/share/info/dir 2>/dev/null
/sbin/ldconfig
preuninstall scriptlet (using /bin/sh):
/sbin/install-info --delete R-FAQ /usr/share/info/dir 2>/dev/null
/sbin/install-info --delete R-admin /usr/share/info/dir 2>/dev/null
/sbin/install-info --delete R-exts /usr/share/info/dir 2>/dev/null
/sbin/install-info --delete R-intro /usr/share/info/dir 2>/dev/null
/sbin/install-info --delete R-lang /usr/share/info/dir 2>/dev/null
postuninstall program: /sbin/ldconfig

$ rpm --noscripts -e R
error: "R" specifies multiple packages:
  R-2.13.0-2.el6.rf.x86_64
  R-3.1.0-5.el6.x86_64
$ R
/usr/bin/R: line 236: /usr/lib64/R/etc/ldpaths: No such file or directory

使用新命令..不确定什么是sudo rpm --noscripts -e --allmatches R吗?

$ sudo rpm --noscripts -e --allmatches R
$ R
/usr/bin/R: line 236: /usr/lib64/R/etc/ldpaths: No such file or directory

$ sudo yum reinstall R
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Reinstall Process
Loading mirror speeds from cached hostfile
epel/metalink                                            | 4.7 kB     00:00     
 * base: centos.aol.in
 * epel: mirror-fpt-telecom.fpt.net
 * extras: centos.aol.in
 * rpmforge: mirror-fpt-telecom.fpt.net
 * updates: centosmirror.go4hosting.in
Cloudera-cdh4                                            |  951 B     00:00     
base                                                     | 3.7 kB     00:00     
cloudera-impala                                          |  951 B     00:00     
extras                                                   | 3.4 kB     00:00     
rpmforge                                                 | 1.9 kB     00:00     
updates                                                  | 3.4 kB     00:00     
No Match for argument: R
Package(s) R available, but not installed.
Nothing to do

$ sudo rpm --noscripts -e --allmatches R
error: package R is not installed

$ R
/usr/bin/R: line 236: /usr/lib64/R/etc/ldpaths: No such file or directory

电流输出: -

$ type -p R
/usr/bin/R

$ sudo yum install R
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * epel: epel.mirror.net.in
 * extras: centos.aol.in
 * rpmforge: mirror-fpt-telecom.fpt.net
 * updates: centosmirror.go4hosting.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package R.x86_64 0:3.1.0-5.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch              Version                   Repository       Size
================================================================================
Installing:
 R            x86_64            3.1.0-5.el6               epel             21 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 21 k
Installed size: 0  
Is this ok [y/N]: y
Downloading Packages:
R-3.1.0-5.el6.x86_64.rpm                                 |  21 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
R-devel-3.1.0-5.el6.x86_64 has missing requires of R-core-devel = ('0', '3.1.0', '5.el6')
R-java-devel-3.1.0-5.el6.x86_64 has missing requires of R-core-devel = ('0', '3.1.0', '5.el6')
  Installing : R-3.1.0-5.el6.x86_64                                         1/1 
Unable to send message to PackageKit
  Verifying  : R-3.1.0-5.el6.x86_64                                         1/1 

Installed:
  R.x86_64 0:3.1.0-5.el6                                                        

Complete!

$ R
/usr/bin/R: line 236: /usr/lib64/R/etc/ldpaths: No such file or directory

我们如何构建已删除的二进制文件,它已安装但未构建文件以执行R

1 个答案:

答案 0 :(得分:0)

rpm -q --scripts R说preun scriptlet正在做什么?

你可以试着让那个文章不会失败。

或者,如果失败或者如果scriptlet没有做任何重要事情,你可以运行rpm --noscripts -e R告诉rpm不要运行包scriptlet。

使用' yum重新安装R`以重新安装R,即使它已安装,如果这是你想要做的。 (在任何情况下,你都不应该删除这样的随机打包文件。这对任何事都没有帮助)。

要解决error: "R" specifies multiple packages问题,您可以(可能)使用rpm --noscripts -e --allmatches R

编辑:包括评论中的建议,最终解决方案似乎涉及安装(和重新安装)所有各种R软件包(R,R-devel,R-core,R-core-devel)。