Say you messed up your alternatives for liblapack.so.3, but you had the output from the –display option:
Then run these commands to restore your alternatives:
Or the more complex example:
Then run:
Explanation: the first argument to
is the generic link which programs will actually use to link shared objects or execute a binary such as
The second argument is just the name of the generic program, which is usually just chosen to be the actual filename of the generic link. This is the name that will appear in the
directory. The third argument is the path of the actual location of the binary/shared object/whatever else file. The fourth is the priority - the higher, the more preferential.
Then we have the slaves which take only three arguments - these correspond to the three arguments for the master link. Basically, these don't actually have to have anything to do with the master link, but in practice, they would be related, e.g. by all the slaves being versions of a program. E.g. if you had Vim v6 and v7, you could have a master for v6 and v7, and the slaves of these would be ex, vimdiff, view etc. Then say you wanted to upgrade to v7, you just run one command and all v6 copies of ex, vimdiff and view get updated to v7!
But in general, they exist as links just like the master link, and can link to totally different, or the same object. In the above example for libblas.so.3, if we are using /usr/lib/atlas-base/atlas/libblas.so.3, then /usr/lib/libatlas.so.3gf exists. But if we change the configuration via --set to point to /usr/lib/libblas/libblas.so.3, then /usr/lib/libatlas.so.3gf is removed.
Bonus points to anyone who can (be bothered to) write a script to automate this.