Changing default programs

September 20th, 2008 by webstersprodigy

In the old days, things like EDITOR could be set using environment variables (eg setting it in /etc/profile).  I tried to do this recently, and when it didn’t work I investigated.

Probably due to the huge number of default programs (eg web browser, gnome text editor, console text editor, flash plugin, ftp programs, the list goes on.. ) they decided to put this junk in etc instead, and have this directory full of symbolic links.  So editor is actually set in /etc/alternatives as a symbolic link.

blah@debian:/etc/alternatives$ ls -l editor
lrwxrwxrwx 1 root root 9 2008-08-27 17:28 editor -> /bin/nano

Anyway, to change these values you can either change where the links point or use the update-alternatives command.  So to change the default text editor to vim in Ubuntu, you could

update-alternatives –config editor

Then select vim.

Tags:

Leave a Reply


No computers were harmed in the 0.183 seconds it took to produce this page.