Tag: update-alternatives

  • update-alternatives

    Set default editor in Ubuntu

    To change vi editor run

    root@backup:~# update-alternatives --config vi
    There are 2 choices for the alternative vi (providing /usr/bin/vi).
    
      Selection    Path                Priority   Status
    ------------------------------------------------------------
    * 0            /usr/bin/vim.basic   30        auto mode
      1            /usr/bin/vim.basic   30        manual mode
      2            /usr/bin/vim.tiny    10        manual mode
    
    Press  to keep the current choice[*], or type selection number: 
    root@backup:~# 
    

    To display current vi config, run

    root@backup:~# update-alternatives --display vi
    vi - auto mode
      link best version is /usr/bin/vim.basic
      link currently points to /usr/bin/vim.basic
      link vi is /usr/bin/vi
      slave vi.1.gz is /usr/share/man/man1/vi.1.gz
      slave vi.fr.1.gz is /usr/share/man/fr/man1/vi.1.gz
      slave vi.it.1.gz is /usr/share/man/it/man1/vi.1.gz
      slave vi.ja.1.gz is /usr/share/man/ja/man1/vi.1.gz
      slave vi.pl.1.gz is /usr/share/man/pl/man1/vi.1.gz
      slave vi.ru.1.gz is /usr/share/man/ru/man1/vi.1.gz
    /usr/bin/vim.basic - priority 30
      slave vi.1.gz: /usr/share/man/man1/vim.1.gz
      slave vi.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
      slave vi.it.1.gz: /usr/share/man/it/man1/vim.1.gz
      slave vi.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
      slave vi.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
      slave vi.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
    /usr/bin/vim.tiny - priority 10
      slave vi.1.gz: /usr/share/man/man1/vim.1.gz
      slave vi.fr.1.gz: /usr/share/man/fr/man1/vim.1.gz
      slave vi.it.1.gz: /usr/share/man/it/man1/vim.1.gz
      slave vi.ja.1.gz: /usr/share/man/ja/man1/vim.1.gz
      slave vi.pl.1.gz: /usr/share/man/pl/man1/vim.1.gz
      slave vi.ru.1.gz: /usr/share/man/ru/man1/vim.1.gz
    root@backup:~#