How can I uninstall Ruby on ubuntu?

166,022

Solution 1

This command should do the trick (provided that you installed it using a dpkg-based packet manager):

aptitude purge ruby

Solution 2

Run the following command from your terminal:

sudo apt-get purge ruby

Usually works well for me.

Solution 3

At first find out where 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

Solution 4

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

grub-pc 
grub-gfxpayload-lists
grub2-common
grub-pc-bin 
grub-common 

Solution 5

On Lubuntu, I just tried apt-get purge ruby* and as well as removing ruby, it looks like this command tried to remove various things to do with GRUB, which is a bit worrying for next time I want to reboot my computer. I can't yet say if any damage has really been done.

Share:
166,022
khanh
Author by

khanh

Hi, I'm Khanh, a seasoned software engineer based in VietNam

Updated on April 12, 2020

Comments

  • khanh
    khanh about 4 years

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

  • khanh
    khanh over 13 years
    thanks for your response. It didn't sloved this problem. I execute this command and check ruby -v. it still show ruby 1.8.7
  • khanh
    khanh over 13 years
    $ sudo aptitude purge ruby No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 0B of archives. After unpacking 0B will be used.
  • khanh
    khanh over 13 years
    $ruby -v ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
  • jwueller
    jwueller over 13 years
    It seems like aptitude did not find the package ruby on your system. Execute dpkg -l | grep ruby for a list of installed ruby-related packages. For example ruby1.8.
  • khanh
    khanh over 13 years
    yes. I execute this command. this is result libopenssl-ruby, ruby-enterprise 1.8.7-2010.02, ruby1.8 1.8.6.111-2ubuntu1...
  • jwueller
    jwueller over 13 years
    Then simply execute aptitude purge ruby1.8 to remove that package.
  • sestevez
    sestevez over 12 years
    sudo apt-get purge ruby* will remove grub! Be careful.
  • theamoeba
    theamoeba over 12 years
    Ok, I have never seen that happen. I will look out for that :)
  • Francois
    Francois about 12 years
    I did sudo apt-get purge ruby* but when I type ruby -v it shows ruby 1.9.2
  • Ang
    Ang about 12 years
    @Francois I think you should use sudo apt-get remove ruby1.9.2 ? I have 1.9.1 installed and it works
  • Francois
    Francois about 12 years
    yea seemed to do the trick, thanks, I keep tryping uninstall instead of remove :)
  • sh4
    sh4 over 11 years
    The same happened to me, but it gives you the clue on what packages yo have to uninstall to remove ruby. So just remove all the packages the apt suggested, except for the obvious ones you don't want to remove, like grub, and you are done.
  • vogdb
    vogdb almost 11 years
    In my case also sudo apt-get autoremove was needed after sudo apt-get remove ruby1.9.3
  • Nabil Kadimi
    Nabil Kadimi about 10 years
    I suggest that you add sudo in your answer for lazy "copiers/pasters" like the person that wrote my comment.
  • Shankar Regmi
    Shankar Regmi about 8 years
    @sestevez I accidently did sudo apt-get purge ruby* and I haven't turned off my system. Can I install grub and update grub