Change default application

Change default mail client from postfix to exim

[root@centos alternatives]# ll
total 0
lrwxrwxrwx. 1 root root 15 Oct 15 11:29 ld -> /usr/bin/ld.bfd
lrwxrwxrwx. 1 root root 34 Oct 15 12:08 libnssckbi.so.x86_64 -> /usr/lib64/pkcs11/p11-kit-trust.so
lrwxrwxrwx. 1 root root 26 Oct 15 14:10 mta -> /usr/sbin/sendmail.postfix
lrwxrwxrwx. 1 root root 40 Oct 15 14:10 mta-aliasesman -> /usr/share/man/man5/aliases.postfix.5.gz
lrwxrwxrwx. 1 root root 22 Oct 15 14:10 mta-mailq -> /usr/bin/mailq.postfix
lrwxrwxrwx. 1 root root 38 Oct 15 14:10 mta-mailqman -> /usr/share/man/man1/mailq.postfix.1.gz
lrwxrwxrwx. 1 root root 27 Oct 15 14:10 mta-newaliases -> /usr/bin/newaliases.postfix
lrwxrwxrwx. 1 root root 43 Oct 15 14:10 mta-newaliasesman -> /usr/share/man/man1/newaliases.postfix.1.gz
lrwxrwxrwx. 1 root root 23 Oct 15 14:10 mta-pam -> /etc/pam.d/smtp.postfix
lrwxrwxrwx. 1 root root 22 Oct 15 14:10 mta-rmail -> /usr/bin/rmail.postfix
lrwxrwxrwx. 1 root root 25 Oct 15 14:10 mta-sendmail -> /usr/lib/sendmail.postfix
lrwxrwxrwx. 1 root root 41 Oct 15 14:10 mta-sendmailman -> /usr/share/man/man1/sendmail.postfix.1.gz
[root@centos alternatives]# alternatives --config mta

There are 2 programs which provide 'mta'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/sbin/sendmail.postfix
   2           /usr/sbin/sendmail.exim

Enter to keep the current selection[+], or type selection number: 2
[root@centos alternatives]# ll
total 0
lrwxrwxrwx. 1 root root 15 Oct 15 11:29 ld -> /usr/bin/ld.bfd
lrwxrwxrwx. 1 root root 34 Oct 15 12:08 libnssckbi.so.x86_64 -> /usr/lib64/pkcs11/p11-kit-trust.so
lrwxrwxrwx  1 root root 23 Oct 30 16:43 mta -> /usr/sbin/sendmail.exim
lrwxrwxrwx  1 root root 19 Oct 30 16:43 mta-mailq -> /usr/bin/mailq.exim
lrwxrwxrwx  1 root root 29 Oct 30 16:43 mta-mailqman -> /usr/share/man/man8/exim.8.gz
lrwxrwxrwx  1 root root 24 Oct 30 16:43 mta-newaliases -> /usr/bin/newaliases.exim
lrwxrwxrwx  1 root root 15 Oct 30 16:43 mta-pam -> /etc/pam.d/exim
lrwxrwxrwx  1 root root 19 Oct 30 16:43 mta-rmail -> /usr/bin/rmail.exim
lrwxrwxrwx  1 root root 19 Oct 30 16:43 mta-rsmtp -> /usr/bin/rsmtp.exim
lrwxrwxrwx  1 root root 18 Oct 30 16:43 mta-runq -> /usr/bin/runq.exim
lrwxrwxrwx  1 root root 22 Oct 30 16:43 mta-sendmail -> /usr/lib/sendmail.exim

Change default java version

# alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
Enter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) - For example, if 2 versions were installed then:

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3
# alternatives --config java
There are 3 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/java/latest/bin/java
Enter to keep the current selection[+], or type selection number: 3
# java -version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)