update-alternatives: error: alternative ri can't be slave of ruby: it is a master alternative.

Bug #876097 reported by Leon Maurer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ri (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This is similar to bug 874343, but I was able to fix that one on my own (it was fixed by removing some ruby 1.9.2 packages). The story is that I just upgrade to 11.10, but ran in to a problem during the upgrade: a bunch of ruby packages refused to install. I cleaned up and finished the installation otherwise, and removed the offending packages to get to the root of the problem. If I try to install the 'ruby' package I now get:

leon@leon-desktop:~$ sudo apt-get install ruby
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  ruby1.8
Suggested packages:
  ri ruby-dev ruby1.8-examples ri1.8
The following NEW packages will be installed:
  ruby ruby1.8
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 40.7 kB of archives.
After this operation, 475 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://mirror.anl.gov/pub/ubuntu/ oneiric/main ruby1.8 amd64 1.8.7.352-2 [35.7 kB]
Get:2 http://mirror.anl.gov/pub/ubuntu/ oneiric/main ruby all 4.8 [5,054 B]
Fetched 40.7 kB in 0s (299 kB/s)
Selecting previously deselected package ruby1.8.
(Reading database ... 389516 files and directories currently installed.)
Unpacking ruby1.8 (from .../ruby1.8_1.8.7.352-2_amd64.deb) ...
Selecting previously deselected package ruby.
Unpacking ruby (from .../apt/archives/ruby_4.8_all.deb) ...
Processing triggers for menu ...
Processing triggers for man-db ...
Setting up ruby1.8 (1.8.7.352-2) ...
update-alternatives: error: alternative ri can't be slave of ruby: it is a master alternative.
dpkg: error processing ruby1.8 (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of ruby:
 ruby depends on ruby1.8 (>> 1.8.7.334-1); however:
  Package ruby1.8 is not configured yet.
dpkg: error processing ruby (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 ruby1.8
 ruby
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any advice?

Revision history for this message
Leon Maurer (leon-n-maurer) wrote :

Looks like the solution was running

sudo update-alternatives --remove ri /usr/bin/ri1.8

Before that, if I listed the alternatives for ri I'd see:

leon@leon-desktop:~$ sudo update-alternatives --list ri
update-alternatives: warning: alternative /usr/bin/ri1.8 (part of link group ri) doesn't exist. Removing from list of alternatives.

I could run that multiple times, and each time it'd say that it was removing /usr/bin/ri1.8 from the list of alternatives, but it didn't remove it until I told it to with the first command.

I'm not sure why all this was necessary. I don't think my installation was special, but maybe it was.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ri (Ubuntu):
status: New → Confirmed
Revision history for this message
Mikhail S. Pobolovets (styx-mp) wrote :

Thnx to Leon Maurer

```sudo update-alternatives --remove ri /usr/bin/ri1.8```

sloved my problem too.

Revision history for this message
ok (undefineddecoder) wrote :

My error was similar. After installing or updating any package, among others, this error was included.

Setting up ruby1.8 (1.8.7.352-2ubuntu1.1) ...
update-alternatives: error: alternative rdoc can't be slave of ruby: it is a master alternative.
dpkg: error processing ruby1.8 (--configure):

sudo update-alternatives --remove rdoc /usr/bin/rdoc
sudo update-alternatives --remove rdoc /usr/bin/rdoc1.8
sudo update-alternatives --remove rdoc /usr/bin/rdoc1.9.2

solved this problem. I used all three commands because all three directories existed.

No errors to report during `apt-get update` and `apt-get upgrade` or installing or upgrading any package.
Thanks a bunch Leon Maurer!

I just realized the last post was a year ago today.

uname -a says

Linux bt 3.2.6 #1 SMP Fri Feb 17 10:34:20 EST 2012 x86_64 x86_64 x86_64 GNU/Linux

(Backtrack5R1 upgraded to ubuntu 12.04 (Precise))

Feel free to email me if more information about my installation would be useful.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.