从UBUNTU 14.0.4 LTS卸载Ruby时出现错误



我在安装Ruby时犯了一些错误,现在我正试图卸载它(如何从ubuntu中删除Ruby),但它给出了以下错误。我尝试了sudo apt-get purge ruby,但仍然无法卸载。它显示ruby没有安装,但我确实检查并确认它安装在位置/usr/local/bin/ruby。请帮我从我的机器上卸载Ruby和RVM。

$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
$ sudo apt-get purge ruby 1.8.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libhdf5-mpich2-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-prof-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libhdf5-openmpi-1.8.7' for regex '1.8.7'
Note, selecting 'libhdf5-serial-1.8.7' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev-0.0.5.1-87764' for regex '1.8.7'
Note, selecting 'libghc-utility-ht-dev' instead of 'libghc-utility-ht-dev-0.0.5.1-87764'
Note, selecting 'libghc-utility-ht-prof' instead of 'libghc-utility-ht-prof-0.0.5.1-87764'
Package 'libhdf5-1.8.7' is not installed, so not removed
Package 'libhdf5-serial-1.8.7' is not installed, so not removed
Package 'libhdf5-mpich2-1.8.7' is not installed, so not removed
Package 'libhdf5-openmpi-1.8.7' is not installed, so not removed
Package 'ruby' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 567 not upgraded.

如果您正在使用rvm,那么您可以使用命令

卸载ruby 1.8.7
rvm unistall 1.8.7

,然后使用命令

卸载RVM
rvm implode

如果你想完全删除ruby,

sudo apt-get purge ruby rubygems

或者你可以按照下面的步骤,

用这个找出它是什么

$ readlink -f /usr/local/bin/ruby
/usr/local/bin/ruby1.8.7

使用此命令查找正在使用的包:

$ dpkg -S /usr/local/bin/ruby1.8.7
ruby1.8: /usr/local/bin/ruby1.8.7

并使用这个来安装,

$ apt-get purge ruby1.8.7

我已经从home目录中删除了ruby目录,并按照以下步骤操作…

$ whereis ruby
ruby: /usr/local/bin/ruby /usr/local/lib/ruby
$ ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
$ sudo rm -rf /usr/local/bin/ruby
$ sudo rm -rf /usr/local/lib/ruby
$ ruby -v
bash: /usr/local/bin/ruby: No such file or directory

终于被卸载了!!感谢Rick

最新更新