How can I uninstall Ruby on ubuntu?

前端 未结 11 1530
长情又很酷
长情又很酷 2020-11-28 05:45

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

相关标签:
11条回答
  • 2020-11-28 06:19

    If you used rbenv to install it, you can use

    rbenv versions 
    

    to see which versions you have installed.

    Then, use the uninstall command:

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

    for example:

    rbenv uninstall 2.4.0  # Uninstall Ruby 2.4.0
    

    If you installed Rails, it will be removed, too.

    0 讨论(0)
  • 2020-11-28 06:21

    Run the following command on the terminal:

    sudo apt-get autoremove ruby
    
    0 讨论(0)
  • 2020-11-28 06:21

    You can use sudo apt remove ruby

    0 讨论(0)
  • 2020-11-28 06:22

    Uninstall the make install software when make uninstall invalid.

    • make install will create file '.installed.list'
    • Choose to clean up the files described in .installed.list (need to be careful if you have multiple versions)
    • Case: ruby2.4 switch to ruby2.3, thinking directly delete all ruby software, and then re-make install 2.3, see: Ruby # Installation Guide
    • make install -> .installed.list
    • see .installed.list file, delete all install files.

    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
    
    0 讨论(0)
  • 2020-11-28 06:25

    Run the following command from your terminal:

    sudo apt-get purge ruby

    Usually works well for me.

    0 讨论(0)
提交回复
热议问题