Upgrade nano editor on Raspberry Pi OS (Raspbian)

Upgrade nano editor on Raspberry Pi OS (Raspbian)

Today I realised that my Raspberry Pi is running an old version (v3.2) of nano that was released 3 years ago. The latest version is currently v5.9. Huge difference.

So I decided to upgrade the nano editor on my Raspberry Pi.

Let's see how I did it:

  1. Check the current version of the nano
    nano -V

  2. Open the "sources.list" file with our favorite editor :)
    sudo nano /etc/apt/sources.list

  3. Comment all lines, and add these ones
    deb http://raspbian.raspberrypi.org/raspbian/ testing main contrib non-free rpi
    deb http://mirrordirector.raspbian.org/raspbian testing main contrib non-free rpi

  4. Run apt update for refresh the list of available packages
    apt update

  5. Upgrade ONLY the nano - DO NOT update everything, this repository contains packages with testing status. The RPi can be unstable after installing all packages!
    sudo apt-get install --only-upgrade nano

  6. Check the nano version again
    nano -V

  7. Comment both added lines in sources.list file, and uncomment the original lines
    sudo nano /etc/apt/sources.list

  8. Enjoy your upgraded nano editor :)