Howtodojo logo
  • Home 
  • About 
  • Certifications 
  • Sample Database 
  • Cheatsheet 
  • Glossary 
  • Blog 
  • Tags 
  1.   Blog
  1. Home
  2. Blog
  3. How To Change Visudo Default Editor

How To Change Visudo Default Editor

Share via
Howtodojo
Link copied to clipboard

In this tutorial we learn how to change `visudo` default editor.

How To Change Visudo Default Editor

In this tutorial we learn how to change visudo default editor. I use Ubuntu 20.04 for this tutorial but you should be able to follow this tutorial on any versions and flavors of Ubuntu.

To change visudo default editor, you can use the command below.

sudo update-alternatives --config editor
```bash

It will prompt which editor that you want to use. Choose the number of editor that you want to use and press enter

```bash
There are 3 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path               Priority   Status
------------------------------------------------------------
* 0            /bin/nano           40        auto mode
  1            /bin/ed            -100       manual mode
  2            /bin/nano           40        manual mode
  3            /usr/bin/vim.tiny   15        manual mode

Press <enter> to keep the current choice[*], or type selection number:

Now your default editor for visudo already changed to vim or another editor of your choosing.

 How To Enable Passwordless Sudo in Ubuntu
How To Install MongoDB 4.0 on Ubuntu 18.04 
Follow me

We publish tutorials, tips and tricks about Linux, open source, cloud computing, and infrastructure

     
Copyright © 2012 - 2025 howtodojo.com. |
Howtodojo
Code copied to clipboard