Skip to content

Instantly share code, notes, and snippets.

@jpylypiw
Created January 28, 2020 14:27
Show Gist options
  • Save jpylypiw/f13de2758ca8a8858a15d619570bb10a to your computer and use it in GitHub Desktop.
Save jpylypiw/f13de2758ca8a8858a15d619570bb10a to your computer and use it in GitHub Desktop.
how to use alternatives on linux

how to configure linux alternatives

notices

  • this only can be used by root
  • the file /usr/bin/python in the example will be replaced! Copy the file before performing changes.

example for python

alternatives --list | grep -i python
alternatives --install /usr/bin/python python /usr/bin/python2.7 1
alternatives --install /usr/bin/python python /usr/bin/python3.6 2
alternatives --install /usr/bin/python python /usr/local/bin/python3.7 3
alternatives --config python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment