4

So far nano seems my favorite terminal editor, but I noticed I have pretty old GNU nano 2.2.6 While latest is GNU nano 2.8.6.

I tried: sudo apt-get install nano but it said I already using newest version, while it's obviously not true.

Could anyone help me updating it to latest, or at least newer than what is current? I've read that new versions have some nice feature, that I would love to use.

1 Answer 1

5

Why does Raspbian think you have the latest version of nano when you don't?

I'm guessing you're running Raspbian Jessie. If you are, it turns out that 2.2.6 is the latest version of nano in the repository, so clearly when APT checks the repository, it finds that you're already up-to-date and doesn't upgrade anything.

Why isn't the version in the repository updated then?

That's down to how Debian's release system works. I'd encourage you to read the second half of my previous answer on a similar topic—essentially, once a release is marked stable, no packages will receive feature updates, ever.

Alright, just tell me how to fix the problem!

Version 2.8.6 is in the buster (testing) repository. Because you're a responsible Debian user and don't want to make a FrankenDebian, you might want to add the backports repository instead to access these packages.

As noted in the documentation:

For stretch add this line

deb http://ftp.debian.org/debian stretch-backports main

to your sources.list (or add a new file with the ".list" extension to /etc/apt/sources.list.d/) You can also find a list of other mirrors at https://www.debian.org/mirror/list

[...]

If you want to install something from backports run:

apt-get -t stretch-backports install "package"

If you're still using Jessie, use the instructions before that for jessie-backports.

Give that a try with nano, and hopefully it should be compatible. I've heard that occasionally Debian's repos vary slightly from the official Raspbian repositories, but it should work in this case. Good luck!

4
  • 1
    Great insight into how Debian works overall. It seems I'm running Jessie, not Stretch, does that change things?
    – SoulJam
    Commented Aug 22, 2017 at 16:57
  • 1
    I did more research, and apparently GNU nano in Stretch is 2.7.4. So I think I will just upgrade Raspberry pi to Stretch, instead of using unstable software.
    – SoulJam
    Commented Aug 22, 2017 at 17:02
  • 2
    @SoulJam If you want 2.8.6, I would imagine the easiest way would be to upgrade your whole system to stretch (that's the new stable anyway, so should be relatively reliable), then you can use stretch-backports, so you end up with an up-to-date system, plus the latest nano. Make sure you back things up and follow reliable instructions when upgrading your system if there's anything important on there!
    – Aurora0001
    Commented Aug 22, 2017 at 17:05
  • 1
    Going on 4 years old, and this remains a good answer. Maybe you'd consider adding a bit to address how to mitigate risks of building from source? There are so many recent changes to nano - I use 4.8 on Ubuntu, but still stuck w/ 3.2 in buster.
    – Seamus
    Commented Mar 29, 2021 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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