Anyone know what is the default text editor for Ubuntu Server 22.04 LTS with minimal installation?

I tried vim, nano, editor, gedit. none of the above is working.

  • 1
    gedit is the GNOME editor, so unless you added GNOME (ubuntu-desktop) to your system, why would it be there? I'd expect vi to be included; ie. the basic editor & not vim (VI improved). If you don't have an editor you like; why not just add one?
    – guiverc
    Jun 22 at 6:24

4 Answers 4


Try vi instead of vim or you could install nano using the following commands:

sudo apt update
sudo apt install nano
  • This requires network, and network seems hard to configure without an editor. Is there an easy way?
    – hey
    Jul 22 at 4:26
  • 1
    @hey vi doesn't require network.
    – mchid
    Jul 22 at 18:15

I had the same question, and I'm a little scared to report that it appears there isn't an editor installed with the Ubuntu 22.04 LTS minimal server install...

Ubuntu (including the minimal server install) ships with a utility to set the default editor (aptly named select-editor; see the Ubuntu select-editor Manpage). Honestly, it's kind of ironic, given the following, but... *shrugs*

I ran select-editor on my fresh minimal server install and got:

user@server:/$ select-editor
update-alternatives: error: no alternatives for editor

So I installed nano, and ran it again to see what would happen:

user@server:/$ select-editor

It seems that, now that there's only one editor installed, it ran without any further input and threw no errors.

To sate my growing curiosity, I installed vim as well and ran select-editor again:

user@server:/$ select-editor
Select an editor.  To change later, run 'select-editor'.
  1. /bin/nano        <---- easiest
  2. /usr/bin/vim.basic

Choose 1-2 [1]:

So all I can conclude from this is that the Ubuntu 22.04 LTS minimal server install does not ship with a text editor. *shrugs again; shakes head in disbelief*

  • This is unfortunate, I need a text editor to fix my internet so I can install a text editor Edit: cat - > /path/to/file was a usable solution
    – Eric Wolf
    Sep 20 at 15:25

Create a text file and name it FILE.txt. Your default text editor is the one that opens when you run the following command:

sudoedit FILE.txt
  • 1
    This wont work on ubuntu server minimal install which does NOT ship nano.
    – Thomas Ward
    Aug 2 at 12:23

You can use cat in a pinch (I needed to fix my netplan.yaml in order to connect to the internet, and thus couldn't install another editor)

cat - > /path/to/file then just ctrl+c to exit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.