2

I have done a terrible deed while linking javac to /usr/bin

I accidentally pasted wrong command line and now I cannot use sudo anymore and thus, I can't access any file or folder which needs permission.

It says

bash: /usr/bin/sudo: Too many levels of symbolic links

The command line which I wrongly paseted is

sudo ln -f -s sudo ln -f -s /opt/jdk1.8.0_151/bin/javac /usr/bin

But it should be

sudo ln -f -s /opt/jdk1.8.0_151/bin/javac /usr/bin

But I already messed up. So, please, if anyone have any idea of how I can fix that, I'll be very thankful.

1 Answers1

1

Run the following to fix the error.

/usr/bin/sudo rm /usr/bin/javac

If the above line doesn't work, see if you can change to the root user then try again:

su root
rm /usr/bin/javac

Then rerun the correct line.

Hope this helps!

Terrance
  • 43,712