How to Fix: What exactly does `update-alternatives` do?
Update-alternatives command used for managing alternative packages in Linux.
📋 Table of Contents
The command `update-alternatives` is used to manage alternative versions of executables on Linux systems. It allows users to specify which executable should be used when multiple versions are available. This can be particularly useful for developers who need to use specific versions of tools or libraries for development purposes.
Using `update-alternatives` is different from adding a JDK to the path because it provides a more explicit and flexible way of managing alternative executables. With `update-alternatives`, you can specify the priority and location of each executable, whereas adding a JDK to the path simply updates the system's PATH environment variable.
If you have run the command `sudo update-alternatives --install /usr/bin/java java /usr/local/java/jre1.7.0_09/bin/java 1` without understanding what it does, you may want to revert back to the original state by removing the alternative executable and restoring the system's default behavior.
To revert back to the original state, you can use the `sudo update-alternatives --remove java /usr/local/java/jre1.7.0_09/bin/java` command to remove the alternative executable, followed by a `sudo update-alternatives --reset java` command to reset the system's default behavior.
In conclusion, `update-alternatives` is a powerful tool for managing alternative versions of executables on Linux systems. By understanding how it works and using it correctly, you can improve your development workflow and ensure that your system behaves as expected.
⚠️ Common Causes
✅ Best Solutions to Fix It
Update System Settings
Alternative Advanced Fix
✨ Wrapping Up
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid