How to fix the version issue between Neovim and LazyVim on Ubuntu 20 or 22 version

1.4k Views Asked by At

I cannot install the LazyVim for Nvim that is under version 0.8.

# required
`mv ~/.config/nvim{,.bak}`

# optional but recommended
`mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}`

# clone the starter
`git clone https://github.com/LazyVim/starter ~/.config/nvim`

# remove the .git folder, so you can add it to your own repo later
`rm -rf ~/.config/nvim/.git`

The above does not work. It just installs version 0.6 of Neovim and that does not accept loading LazyVim for that version.

How do I install a version greater than or equal to 0.8?

2

There are 2 best solutions below

0
ISRAEL KUASSI On
# First step
sudo apt update

# Second step
sudo apt upgrade

# Run the following commands
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage
# Run the following commands if the ./nvim.appimage command fails, try:
./nvim.appimage --appimage-extract
./squashfs-root/AppRun --version
# Optional: exposing nvim globally.
sudo mv squashfs-root /
sudo ln -s /squashfs-root/AppRun /usr/bin/nvim
nvim
# If we got errors for existing or this file /usr/bin/nvim
sudo rm /usr/bin/nvim
sudo ln -s /squashfs-root/AppRun /usr/bin/nvim
nvim
0
MParker On

I had the same issue, I first tried using the neovim PPA here: https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable

However the latest version on there is still only 0.7.2.

I got it to work installing via AppImage as described here, to get the latest release build which is currently 0.9.5: https://github.com/neovim/neovim/releases/tag/stable

So first remove your current install:

sudo apt remove neovim

Then download the AppImage:

wget https://github.com/neovim/neovim/releases/download/stable/nvim.appimage

Make it executable and run it:

chmod u+x nvim.appimage && ./nvim.appimage

If you get a fuse error (as I did on Ubuntu 22.04), then you can first verify that you have fuse3:

dpkg -l | grep fuse3

If you see output showing you have it, then you can safely install the fuse 2 library side by side:

sudo apt install libfuse2

If you do NOT have fuse3 (as might be the case in pre-22 versions of Ubuntu), follow the instructions here: https://docs.appimage.org/user-guide/troubleshooting/fuse.html#how-to-install-fuse OR you can look at the manual extraction instructions on the nvim release build page: https://github.com/neovim/neovim/releases/tag/stable

Then try to run the app image again:

./nvim.appimage

Once working, I first moved it into a .bin folder so it wasn't just sitting in my home directory:

mv nvim.appimage ~/.bin/nvim.appimage

And added the following lines (aliases) to my .bashrc as per my personal preference:

# Editors
alias vi='~/.bin/nvim.appimage'
alias vim='~/.bin/nvim.appimage'
alias nvim='~/.bin/nvim.appimage'

Since I use those first two aliases anyway, I just added the nvim alias and didn't bother adding anything to $PATH.

Apparently some app images have updating built into them, but I don't think Neovim's does, so you will probably have to update it manually (unfortunately) - however it is a simple procedure (just download it and make it executable).

However, if you ever want to be able to run it as root (including with sudo), then you'll want to install it machine-wide, in which case just move it to /usr/bin:

sudo mv ~/.bin/nvim.appimage /usr/bin/nvim.appimage

And update aliases accordingly in your .bashrc

# Editors
alias vi='/usr/bin/nvim.appimage'
alias vim='/usr/bin/nvim.appimage'
alias nvim='/usr/bin/nvim.appimage'

Or just add it to $PATH if you prefer.