update-alternatives inconsistent after package upgrade

Bug #1794949 reported by jd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-defaults (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

$ gcc -v
...
gcc version 8.1.0 (Ubuntu 8.1.0-1ubuntu1)
$ sudo apt update && sudo apt upgrade
...
The following packages will be upgraded:
  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-7 cpp-8 g++ g++-7
  g++-8 gcc gcc-7 gcc-7-base gcc-8 gcc-8-base gdm3 gir1.2-gdm-1.0 lib32gcc1
  lib32stdc++6 libasan4 libasan5 libatomic1 libbinutils libcc1-0 libcilkrts5
  libgcc-7-dev libgcc-8-dev libgcc1 libgdm1 libgomp1 libitm1 liblsan0 libmpx2
  libnautilus-extension1a libobjc-7-dev libobjc4 libquadmath0 libstdc++-7-dev
  libstdc++-8-dev libstdc++6 libtsan0 libubsan0 libubsan1 nautilus
  nautilus-data python3-distupgrade tzdata ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk
...
Setting up gcc-7 (7.3.0-27ubuntu1~18.04) ...
Setting up g++-7 (7.3.0-27ubuntu1~18.04) ...
Setting up gcc (4:7.3.0-3ubuntu2.1) ...
Setting up gcc-8 (8.2.0-1ubuntu2~18.04) ...
Setting up g++-8 (8.2.0-1ubuntu2~18.04) ...
Setting up g++ (4:7.3.0-3ubuntu2.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
$ gcc -v
...
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
$ update-alternatives --display gcc
gcc - auto mode
  link best version is /usr/bin/gcc-8
  link currently points to /usr/bin/gcc-8
  link gcc is /usr/bin/gcc
  slave g++ is /usr/bin/g++
/usr/bin/gcc-7 - priority 700
  slave g++: /usr/bin/g++-7
/usr/bin/gcc-8 - priority 800
  slave g++: /usr/bin/g++-8
$ $ ll /usr/bin/gcc
lrwxrwxrwx 1 root root 5 Sep 17 09:07 /usr/bin/gcc -> gcc-7*

So after the upgrades update-alternatives shows that /usr/bin/gcc points to /usr/bin/gcc-8 as it was before the upgrades, when in fact it points to gcc-7.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Reassigning to gcc. gcc does not appear to be managed by update-alternatives. AFAIUI, update-alternatives updates symlinks in /etc/alternatives. So /usr/bin/gcc would have to point to /etc/alternatives/gcc which then points to gcc-8.

But /usr/bin/gcc is provided by the gcc package as a fixed symlink to a specific versioned one, not an alternative.

So this seems like an upgrade bug or something: You have a gcc alternative where you should not have one.

affects: apt (Ubuntu) → gcc-defaults (Ubuntu)
Changed in gcc-defaults (Ubuntu):
status: New → Invalid
Revision history for this message
Matthias Klose (doko) wrote :

invalid. The gcc symlink is not managed by alternatives. If yu mess around with your system, please clean that up on your own.

Revision history for this message
Julian Andres Klode (juliank) wrote :

It seems that you have created the alternative yourself, which is not supported, and hence the bug is invalid. Please do not create alternatives that don't exist.

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.