25

I had to run the command sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20, but unfortunately I misstyped and wrote sudo update-alternatives --install /usr/bin/gcc gccc /usr/bin/gcc-4.8 20 (so gccc instead of gcc).

Now, when trying to run the regular command, it tells me the alternative link /usr/bin/gcc is allready managed by gcccc.

I've searched around but haven't found a solution yet.

jdepypere
  • 353
  • 1
  • 3
  • 6

2 Answers2

27

Do sudo update-alternatives --remove-all gccc.

fkraiem
  • 12,344
  • 4
  • 33
  • 38
  • 7
    If you're using this method to, say, fix a botched `python` or `php` alternative, you'll need to restore an alternative with `--set` or `--install` after removal. As you'd expect, `--remova-all`, disconnects all links to whatever package you're working with, leaving you with none in your `PATH`. – Dale C. Anderson Sep 13 '19 at 18:32
  • 1
    I also had to do `sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 3` and `sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7` to restore my 19.04 system back to what it was (I hope). – Boris Verkhovskiy Oct 18 '19 at 00:21
3
update-alternatives --remove gccc /usr/bin/gcc-4.8

is the answer you seek.

Artur Meinild
  • 21,605
  • 21
  • 56
  • 89