I have installed ruby 1.9.3p0 and on executing the command ruby -v it shows the version 1.9.3p0 installed. When i try to remove it by command sudo apt-get remove ruby1.9.3p0 it says package not found so not removed. What should I do?
5 Answers
The package name is ruby1.9.1 but the software version is 1.9.3, so remove it running:
sudo apt-get remove ruby1.9.1 libruby1.9.1 3 Are you sure when you run ruby you are running system ruby and not rvm or rbenv ruby?
$ which ruby
/home/jrwren/.rvm/rubies/ruby-1.9.2-p0/bin/ruby/usr/bin/ruby uses alternatives - you can read more with man update-alternatives
$ ls -l /usr/bin/ruby
lrwxrwxrwx 1 root root 22 Oct 11 2011 /usr/bin/ruby -> /etc/alternatives/ruby
$ ls -l /etc/alternatives/ruby
lrwxrwxrwx 1 root root 18 Oct 12 16:57 /etc/alternatives/ruby -> /usr/bin/ruby1.9.1So ultimately ruby is a symlink to /usr/bin/ruby1.9.1 You can ask dpkg to which package this file belongs with -S
$ dpkg -S /usr/bin/ruby1.9.1
ruby1.9.1: /usr/bin/ruby1.9.1And remove that package
$ sudo apt-get remove ruby1.9.1At this point the alternatives system will kick in and symlink /usr/bin/ruby to another ruby version on your system if you have it. Mine found a ruby 1.8. Repeat the process if you with to remove that version.
Just simply try sudo apt-get remove ruby, Or type sudo apt-get remove ruby and before pressing Enter press Tab multiple times to see what you can remove about ruby.
sudo apt-get purge ruby And press Tab multiple times to see what you can remove about ruby. After, check with
dpkg -l | grep ruby Try this,
sudo apt-get --purge remove ruby1.9.3p0It will remove all dependency packages also.