linuxbashgradlefedora

How to fix failed to link /usr/bin/gradle -> /etc/alternatives/gradle: /usr/bin/gradle exists and it is not a symlink


I got the below error

failed to link /usr/bin/gradle -> /etc/alternatives/gradle: /usr/bin/gradle exists and it is not a symlink

I want to change the gradle version of my linux fedora from gradle 4.4.1 to gradle 2.14.1.

I have downloaded and extracted the archive of the new gradle file and moved it to /opt location on my laptop and ran the below command on terminal:

sudo update-alternatives --install /usr/bin/gradle gradle /opt/gradle-2.14.1-all/gradle-2.14.1/bin/gradle 2000

I would like advice on how to change the gradle version of my linux fedora from gradle 4.4.1 to gradle 2.14.1. Thanks!


Solution

  • The command below resolves the problem:

    update-alternatives --install /usr/bin/gradle gradle /opt/gradle-2.14.1-all/gradle-2.14.1/bin/gradle