To install ncurses, try sudo apt install ncurses
For the -dev package, try sudo apt install libncurses-dev
There are no -dev packages for libncurses6 nor for libncursesw6.
Answer from user535733 on askubuntu.comlinux - Compiling Kernel : Unable to locate ncurses - Unix & Linux Stack Exchange
Node installation issue - Unable to locate package libncursesw5
vim - Couldn't find package libncurses5-dev - Stack Overflow
linux - libncurses.so.5 library missing in UBUNTU 22.04 installation for ARM64 (rapsberry PI 4) - Stack Overflow
You need to use the "old-releases" archive for Natty Narwhal; replace archive.linux.duke.edu with old-releases.ubuntu.com in your sources.list file, then run sudo apt-get update, and you should be able to install the packages.
As Huygens suggests though, you should really upgrade to a supported version of Ubuntu.
Natty Narwhal is no longer supported by Ubuntu. So you can't use apt-get to install ncurses.
You have the following choices:
- upgrade to a supported version of Ununtu. But as your version is no longer supported, you can't easily upgrade in-place but would rather need to install over. So backup!!!
- install ncurses from sources. Get the source and compile them. Note that it might not be an easy task.
- find a "compatible" repository for Natty which you could use instead of the Ubuntu ones. Maybe a Debian one could work but you need to find from which Debian Natty is derived. This might not work!
I would recommend to try to upgrade to latest Ubuntu. You will benefit from the security updates as well.
Certainly solved and not really related to your initial problem but might help someone :)
Check that you have libncurses5-dev package installed
sudo aptitude search %p libncurses
This should give you something like:
i libncurses5 - Bibliothèques partagées pour l'utilisation d'un terminal
i libncurses5-dev - developer's libraries for ncurses
which here means that the package is installed
Same result with:
find /usr -name "libncurse*"
If not:
sudo apt-get install libncurses5-dev
Then to configure vim with maximum options:
./configure --with-features=huge --with-tlib=ncurses
Go to Sytem -> Administration -> Software Sources and make sure that you have all the relevant sources checked. Then do a apt-get update
This might help:
http://www.liberiangeek.net/2010/06/configuring-software-sources-ubuntu-10-04-lucid-lynx-receive-updatespatches/
I figured this out for Ubuntu 24.x though I could not find the exact answer anywhere, so posting this here for posterity:
First, if you are on amd64 make sure you have the i386 foreign architecture configured. Then follow the advice on the download page for curses by modifying your /etc/apt/sources.list.d/ubuntu.sources. Ensure you have a deb entry for http://security.ubuntu.com/ubuntu. In that entry, ensure you have 'focal-security' as an item for 'Suites' and 'universe' as an item for 'Components.' Run "sudo apt update." Then you should be able to install libncurses5:i386.
You can manually download the 32-Bit libncurses5 package which contains the "libncurses.so.5" file and as well as any other ubuntu packages you may need from the Ubuntu Package Archive (https://packages.ubuntu.com/).
You should have run (as root)
aptitude update
aptitude search libncurses
that would suggest you the right package name.
Then try
aptitude install libncurses-dev
and
aptitude install kernel-package
aptitude build-dep linux-image linux-image-amd64
At last, use make-kpkg --initrd binary to compile your kernel. (it will produce *.deb files in the parent directory). You want to configure /etc/kernel-pkg.conf and perhaps /etc/kernel-img.conf
I had the same problem. In my case installation of package libncursesw5-dev solved the issue.
ncurses provides multiple ABIs in the same distribution. Previously, the default ABI was 5, and now it's 6. libncurses5 provides the v5 ABI, and libncurses6 provides the v6 ABI. You cannot use a piece of software linked against a shared library with an incompatible ABI like this because the shared library paths differ across ABIs so people don't accidentally load the wrong one and break their programs.
If you want to run an existing program linked against ABI v5, then you need the libncurses5 package. You do not need the -dev package unless you are developing against that package. If you are recompiling an existing package, you should use libncurses-dev, which will build against the latest version of ncurses unless you are sure you need to build against the old version. That package will include the curses.h header.
If you want to specify the location of the curses header, you should do that wit angle brackets: #include <curses.h>. It is a system path, and it is definitely provided by libncurses-dev.
If your program is using the standard curses API that's in common use, then recompiling it for a new version of ncurses should not change anything. The ABI changes likely consisted of changing some internal structures which do not affect the display but may enable new terminal features. The behavior of the curses API is standardized and breaking changes would not be expected.
It's likely that your TERM setting is indeed the problem. If you're running in an SSH session on another computer, it's possible that the system you're running it on lacks that terminal definition as part of the standard set, and requires an additional package (on Debian and Ubuntu, ncurses-term) that includes more terminal definitions. You can try running infocmp xterm-256color on that system, assuming it's running ncurses, to see if you do have that terminal definition. It will print terminal info if you do, and an error if you don't.
If you're in a screen or tmux session, then xterm-256color would be the wrong terminal type, and screen-256color would be a better choice. Even if not, you may want to check your terminal settings for the type it's emulating, since some terminal emulators have support for multiple terminal types.
Fixed it. It turns out that the curses calls in the app that didn't work were in a library that I hadn't rebuilt on the 20.04 system. The app that worked had its curses code in local modules that were recompiled when I rebuilt it.
Once I rebuilt the library with the curses calls and relinked the 'broken' app, it's all working with ncurses6. False alarm. Sorry.
I'm running 24.04 in a docker container where I had already installed RVM using Dockerfile. As my next step I want to include a ruby installation through RVM within it as well. However every single time, no matter if I try installing it beforehand, I get a "missing required package" message for libncurses5-dev, stopping the docker image build. Looking at my packages with dpkg turns up that I have libncurses-dev installed, which is the package that installs whenever I try installing libncurses5-dev. Any way to prevent the undesired behavior?
Did you try what was suggested? i.e. libncurses-dev or ncurses-devel ? Not libncurses5-dev
Which distro/version are you using?
Looks like libncurses-dev is a virtual package which brings up libncurses5-dev in Ubuntu 16.04. Fedora 28 has ncurses-devel available in the updates repo.
To install libncurses5-dev ,you should have the following line in your sources.list (from the comment ):
deb http://deb.debian.org/debian/ stretch main
Run :
# echo deb http://deb.debian.org/debian/ stretch main >> /etc/apt/sources.list
# apt update
# apt install libncurses5-dev
