6.12. Installing Ncurses-5.2

Estimated build time:           6 minutes
Estimated required disk space:  29 MB

6.12.1. Installation of Ncurses

Install Ncurses by running the following commands:

./configure --prefix=/usr --libdir=/lib \
   --with-shared --disable-termcap &&
make &&
make install &&
cd /lib &&
mv *.a /usr/lib &&
chmod 755 *.5.2 &&
cd /usr/lib &&
ln -sf libncurses.a libcurses.a &&
ln -sf ../../lib/libncurses.so &&
ln -sf ../../lib/libcurses.so &&
ln -sf ../../lib/libform.so &&
ln -sf ../../lib/libpanel.so &&
ln -sf ../../lib/libmenu.so

6.12.2. Command explanations

--with-shared: This enables the build of the shared ncurses library files.

--disable-termcap: Disabled the compilation of termcap fall back support.

cd /lib && mv *.a /usr/lib : This moves all of the static ncurses library files from /lib to /usr/lib. /lib should only contain the shared files which are essential to the system when /usr may not be mounted.

chmod 755 *.5.2: Shared libraries should be executable. Ncurses install routine doesn't set the permissions properly so we do it manually instead.

ln -sf libncurses.a libcurses.a: Some programs try to link using -lcurses instead of -lncurses. This symlink ensures that such programs will link without errors.

ln -sf ../../lib/libncurses.so etc: These symlinks are created to tidy up the installation. It's good practise to have the *.so files in /usr/lib as well as in /lib, to ensure that the linker is always able to find the files whether it's looking in /lib or /usr/lib.

6.12.3. Contents

6.12.3.2. Descriptions

6.12.4. Dependencies

Ncurses-5.2 needs the following to be installed:


bash: sh
binutils: ar, as, ld, ranlib
diffutils: cmp
fileutils: chmod, cp, install, ln, mkdir, mv, rm
gcc: c++, cc1, cc1plus, collect2, cpp0, gcc
glibc: ldconfig
grep: egrep, fgrep, grep
make: make
gawk: gawk
sed: sed
sh-utils: basename, date, echo, expr, hostname, uname
textutils: cat, sort, tr, wc