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.
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.
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
>> instead of >
– mchid
Apr 29 '23 at 01:45
you can also use 'sed' for simple changes. For example if you want to replace the ip address:
sed -i s/192.0.2.0/192.0.2.1/ /etc/netplan/00-installer-config.yaml
In Ubuntu 22.04 the minimal installation is for machines where no human is logging in. And they really mean it! You are not supposed to ever login. Only automated tools are expected, which of course do not use visual text editors. Indeed, it was quite surprising because in previous Ubuntu versions the minimal installation meant that no regular users are logging in but a few interactive programs were still installed for sysadmins. Not for 22.04.
Abbreviations:
-ibak instead of just -i to create a backup of the original file with 'bak' appended to the name.
– drevicko
Sep 12 '24 at 01:50
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
user@server:/$
So I installed nano, and ran it again to see what would happen:
user@server:/$ select-editor
user@server:/$
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*
cat - > /path/to/file was a usable solution
– 19wolf
Sep 20 '22 at 15:25
Try vi or vim.tiny instead of vim or you could install nano using the following commands:
sudo apt update
sudo apt install nano
cat (it's really not much different than a regular text editor but you can't edit in place, only create new files).sed to edit in place.and the secret third option is to not use the minimized install option if you need more user friendly tools before accessing the internet.
According to the list of installed packages posted here, there is no other text editor. As far as I understand, the minimized setup was originally intended for cloud instances, in which they have internet access by default. So if you want a text editor, they would expect you to install it yourself.
I usually use the mini.iso which is similar. Although it's set up to install over the internet so it obviously assumes you have network access.
Normally, I'll set up a virtual AP from a separate router with a fairly easy password to use during the installation process.
Nothing fancy:
Once everything is installed using apt and/or tasksel, I'll do the full configuration for networking and disable the virtual AP on the router.
So I guess the 4th option would be to make the network easier to connect to using the installer options so that writing a configuration file isn't necessary to access the internet.
vi is not available in Ubuntu Server 22.04 LTS minimal installation, and to install it you need network
– Ron
Apr 27 '23 at 10:05
vi and then press TAB twice and it should either autocomplete or it will show you a list of available commands.
– mchid
Apr 29 '23 at 01:52
vi, vim, nano, joe, pico or vim.tiny in the minimal installation... there's no single editor available, as surprising as that might sound.
– Ron
Apr 29 '23 at 01:54
sudo tasksel first thing after you boot up for the first time to install the server and you can choose whatever other suites you'd like to install as well and it should use the same internet connection used during the prior installation process. Just remember to never use tasksel to uninstall any packages because it will basically uninstall your entire system.
– mchid
Apr 29 '23 at 02:13
vim.tiny nor any of the editors I mentioned above.. Thus the question being asked here.
– Ron
Apr 29 '23 at 02:21
sed is installed if you need to make edits in place. You can use cat for creating a new file from scratch like in the other answer shown.
– mchid
Apr 29 '23 at 02:57
standard server or minimal installation?? cat and sed can be used, but they are not text editor. You could've tested, as I did, instead of guessing, assuming, twisting or keep commenting NOT relevant points...
– Ron
Apr 29 '23 at 03:11
I have checked :
apt list --installed| grep -i vim
result after installation of vim-doc
vim-common/jammy-updates,jammy-updates,jammy-security,jammy-security,now
2:8.2.3995-1ubuntu2.3 all [installed,automatic]
vim-doc/jammy-updates,jammy-updates,jammy-security,jammy-security,now 2:8.2.3995-1ubuntu2.3 all [installed]
vim-tiny/jammy-updates,jammy-security,now 2:8.2.3995-1ubuntu2.3 amd64 [installed,automatic]
It is: VIM - Vi IMproved version 8.2.4919
dpkg -L vim-tiny (vim-common doesn't show an executable vim) the command is vim.tiny
– mchid
Apr 29 '23 at 01:49
geditis the GNOME editor, so unless you added GNOME (ubuntu-desktop) to your system, why would it be there? I'd expectvito be included; ie. the basic editor & notvim(VI improved). If you don't have an editor you like; why not just add one? – guiverc Jun 22 '22 at 06:24