nanosudo? (default update-alternatives --config editor choice)

Paul Sladen ubuntu at
Mon Dec 24 09:11:13 UTC 2012

On Mon, 24 Dec 2012, Phil Dobbin wrote:
> [is this] now standard Ubuntu policy to default to nano rather
> than vim (vi) for visudo

I had a reinvestigate, rather than relying on my memory.  The
requirement is mandated in the following section of the Policy Manual:

  Debian Policy Manual 
  11.4 Editors and pagers
  "‥every program that launches an editor or pager must use the
  EDITOR ‥ environment variable" and "[‥if] not set, the programs
  /usr/bin/editor ‥ should be used"

So you are correct about EDITOR being unset.  Running
'apt-get changelog sudo' brings up an interesting progression of bugs:

    * enable ENV_EDITOR
  Fixed in sudo (1.4.1-1) on 1996-03-05.

  "visudo does not default to vi"
  Fixed in sudo (1.6.9p9-1) on 2007-12-03

  "sudo: ignores configured editor preferences"
  Fixed in sudo (1.6.9p15-2), on 2008-04-16 with a revert + rationale:
  * revert the fix for 388659 such that visudo once again defaults to
    using /usr/bin/editor.  I was always ambivalent about this change, it
    has caused more confusion and frustration than it cured, …"

> so making the nano the default $EDITOR because

So by this stage, $EDITOR should be respected, and if not set should
fallback to /usr/bin/editor, which should default to Nano.  However, I
notice that as-of a couple of months ago, a bug has been opened:

  "vipw uses vi by default; should use /usr/bin/editor"

So this could do with double checking.


More information about the ubuntu-users mailing list