How to remove Ruby on ubuntu?

How can I remove Ruby 1.9.2dev (2010-07-02) [i486-linux] on ubuntu? Need to reinstall - please help

+34
ruby ruby-on-rails ubuntu uninstall
Oct 18 '10 at 9:06
source share
12 answers

This command should do the trick (assuming you installed it using the dpkg-based package manager):

aptitude purge ruby 
+56
Oct 18 '10 at 9:08
source share

sudo apt-get purge ruby

It usually works well for me.

+34
May 12 '11 at 11:57
source share

First find out where the ruby ​​is? then

 rm -rf /usr/local/lib/ruby rm -rf /usr/lib/ruby rm -f /usr/local/bin/ruby rm -f /usr/bin/ruby rm -f /usr/local/bin/irb rm -f /usr/bin/irb rm -f /usr/local/bin/gem rm -f /usr/bin/gem 
+18
Jul 18 '12 at 7:17
source share

I tried a lot to include sudo apt-get purge ruby , sudo apt-get remove ruby and sudo aptitude purpe ruby , with or without '*' at the end. But none of them worked, maybe I installed several versions of ruby.

Finally, when I tried sudo apt-get purge ruby1.9 (with version), it works.

+10
Nov 07 '14 at 1:12
source share

Here is what sudo apt-get purge ruby* has been removed related to GRUB for me:

 grub-pc grub-gfxpayload-lists grub2-common grub-pc-bin grub-common 
+8
Apr 09 '13 at 12:37
source share

On Lubuntu, I just tried apt-get purge ruby ​​*, and also removing ruby, it looks like this command tried to remove various things related to GRUB, which bothers me a little the next time I want to restart my computer. I still can’t say whether any damage was really done.

+4
Jan 08 '13 at 18:21
source share

decision:

sudo apt-get autoremove ruby

+3
Aug 08 '13 at 20:10
source share

Why are you uninstalling the old version of ruby?

rvm install 2.4.2 // version of ruby ​​u need insatll rvm use 2.4.2 --default // install the ruby ​​version that you want to use by default

Using rvm, you can install several versions of ruby ​​on the system

Please follow these steps: install ruby ​​using rvm

 sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm install 2.4.2 rvm use 2.4.2 --default ruby -v 

Installation step will change for another version of Ubuntu

For more information

https://gorails.com/setup/ubuntu/14.04

+1
Nov 04 '17 at 7:46 on
source share

卸载 do the installation 的 软件, do the removal 无效

  • make install 时 会 生成 文件 .installed.list
  • 选择 清理 .installed.list 中 说明 的 文件 (如果 有 多个 版本 时 需要 特别 小心)
  • 案例: ruby2.4 切换 为 ruby2.3, 思路 直接 删除 所有 ruby ​​软件, 然后 重新 make install 2.3

     rm -rf / usr / local / include / ruby- *
     rm -rf / usr / local / lib / ruby
     rm / usr / local / bin / erb / usr / local / bin / gem / usr / local / bin / irb / usr / local / bin / rdoc / usr / local / bin / ri / usr / local / bin / ruby
     rm /usr/local/share/man/man1/erb.1 /usr/local/share/man/man1/irb.1 /usr/local/share/man/man1/ri.1 / usr / local / share / man / man1 / ruby.1
     rm /usr/local/lib/libruby-static.a
     rm -rf / usr / local / lib / pkgconfig / ruby- *
     which ruby
     pkg-config --list-all | grep ruby
    

Uninstall make install software if you make uninstallation invalid.

  • make install will create the file '.installed.list'
  • Choose to clear the files described in .installed.list (be careful if you have multiple versions)
  • Case: ruby2.4 switch to ruby2.3, thinking of directly removing all ruby ​​software, and then reinstalling 2.3 installation, see: Ruby Installation Guide #
  • make install -> .installed.list
  • see .installed.list file, delete all installation files.
0
Mar 08 '17 at 12:48 on
source share

If you used rbenv to install it, you can use

 rbenv versions 

to find out which versions you have installed.

Then use the delete command:

 rbenv uninstall [-f|--force] <version> 

eg:

 rbenv uninstall 2.4.0 # Uninstall Ruby 2.4.0 

If you installed Rails, it will also be uninstalled.

0
Jun 16 '17 at 10:02 on
source share

You can use sudo apt remove ruby

0
Nov 04 '17 at 7:27
source share
 sudo apt-get remove ruby version 

Or use delete

-one
Jun 16 '17 at 19:00
source share