Forrest logo
back to the update-alternatives tool

update-alternatives:tldr:a128b

update-alternatives: Configure a symbolic link for `java`.
$ sudo update-alternatives --config ${java}
try on your machine

This command is used in Linux systems to manage and choose between different alternatives for a specific command or software version.

Here's a breakdown of the command:

  • sudo: This is a command that allows the user to execute a command as the superuser or another user (if specified). It provides elevated permissions required to perform system-level tasks.

  • update-alternatives: This is a Linux command-line tool used to maintain symbolic links for different versions of executables. It helps in managing multiple software versions installed on a system.

  • --config: This option specifies that the command should configure the program whose name is given as an argument.

  • ${java}: This is a placeholder or variable that represents the specific software or command for which alternatives will be selected. In this case, it refers to the "java" command or executable.

By running sudo update-alternatives --config ${java}, the system prompts the user to select from available alternatives for the "java" command. It will present a list of different versions or installations of Java on the system, allowing the user to choose the default version to be used.

The selected alternative will be configured to be the default when the "java" command is executed in subsequent sessions or scripts.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the update-alternatives tool