The version of Neovim available via apt on Raspberry Pi OS is often outdated. If you’re looking to use LazyVim or just want the latest features, you’ll need to compile Neovim from source. Here’s how to do it.
Pre-requisites
You’ll need git and cmake. If you don’t have them, install with:
sudo apt-get install git cmake
Get Neovim source and compile
- Clone the repo from Github
- Compile it
- Package and install
git clone https://github.com/neovim/neovim.git
cd neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo
cd build
cpack -G DEB
sudo dpkg -i nvim-linux64.deb
What’s happening here?
We’re cloning the Neovim repo, then using make
to compile it. The CMAKE_BUILD_TYPE=RelWithDebInfo
option creates a release build with debugging info, which can be helpful if you run into issues.
After compilation, we package it into a .deb file and install it using dpkg
. This approach ensures it’s properly integrated into your system.
Verify the installation
Once it’s done, check that it worked:
nvim --version
You should see the latest version number in the output.
That’s it! You now have the latest Neovim installed on your Raspberry Pi. This setup is perfect for LazyVim or any other Neovim configuration that requires recent features.
Remember, compiling on a Raspberry Pi can take a while, so be patient. Maybe grab a coffee or tea while you wait.