Cyberithub

How to Install Ncurses Library on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, I will take you through the steps to install ncurses library on Ubuntu 20.04 LTS (Focal Fossa). Ncurses or new curses library is a free and open source software emulation of curses in System V Release 4.0 (SVr4), and in many more platforms. It uses terminfo format, supports pads and color and multiple highlights and forms characters and function-key mapping, and has all the other SVr4-curses enhancements over BSD curses. SVr4 curses became the basis of X/Open Curses. Here we will see the steps to install Ncurses Library on Ubuntu 20.04 LTS based systems.

 

How to Install Ncurses Library on Ubuntu 20.04 LTS (Focal Fossa)

How to Install Ncurses Library on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to solve "aclocal not found" error on Ubuntu/Linux

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility available in your Server.

 

Step 2: Update Your Server

Before installing Ncurses library package on your system, it is always a good idea to sync your system with the latest available updates on default Ubuntu repo by using sudo apt update && sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:5 https://download.sublimetext.com apt/stable/ InRelease
Hit:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [407 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Fetched 797 kB in 3s (293 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
firefox firefox-locale-en google-chrome-stable
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 standard LTS security updates
Need to get 155 MB of archives.
After this operation, 401 kB of additional disk space will be used.
.............................................................

 

Step 3: Install Ncurses Library

In the next step, you can install Ncurses library by using sudo apt-get install libncurses5-dev libncursesw5-dev command as shown below. This will download and install the package along with all its dependencies from default Ubuntu repo.

cyberithub@ubuntu:~$ sudo apt-get install libncurses5-dev libncursesw5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libncurses-dev
Suggested packages:
ncurses-doc
The following NEW packages will be installed:
libncurses-dev libncurses5-dev libncursesw5-dev
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 341 kB of archives.
After this operation, 2,409 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libncurses-dev amd64 6.2-0ubuntu2 [339 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libncurses5-dev amd64 6.2-0ubuntu2 [976 B]
Get:3 http://in.archive.ubuntu.com/ubuntu focal/main amd64 libncursesw5-dev amd64 6.2-0ubuntu2 [980 B]
Fetched 341 kB in 2s (181 kB/s)
Selecting previously unselected package libncurses-dev:amd64.
(Reading database ... 196086 files and directories currently installed.)
Preparing to unpack .../libncurses-dev_6.2-0ubuntu2_amd64.deb ...
Unpacking libncurses-dev:amd64 (6.2-0ubuntu2) ...
Selecting previously unselected package libncurses5-dev:amd64.
Preparing to unpack .../libncurses5-dev_6.2-0ubuntu2_amd64.deb ...
Unpacking libncurses5-dev:amd64 (6.2-0ubuntu2) ...
Selecting previously unselected package libncursesw5-dev:amd64.
Preparing to unpack .../libncursesw5-dev_6.2-0ubuntu2_amd64.deb ...
Unpacking libncursesw5-dev:amd64 (6.2-0ubuntu2) ...
Setting up libncurses-dev:amd64 (6.2-0ubuntu2) ...
Setting up libncursesw5-dev:amd64 (6.2-0ubuntu2) ...
Setting up libncurses5-dev:amd64 (6.2-0ubuntu2) ...
Processing triggers for man-db (2.9.1-1) ...

 

Step 4: Verify Installation

After successful installation, you can verify the installed library packages files path by using dpkg -L libncurses-dev libncurses5-dev libncursesw5-dev command as shown below.

cyberithub@ubuntu:~$ dpkg -L libncurses-dev libncurses5-dev libncursesw5-dev
/.
/usr
/usr/bin
/usr/bin/ncurses6-config
/usr/bin/ncursesw6-config
/usr/include
/usr/include/curses.h
/usr/include/cursesapp.h
/usr/include/cursesf.h
/usr/include/cursesm.h
/usr/include/cursesp.h
/usr/include/cursesw.h
/usr/include/cursslk.h
/usr/include/eti.h
/usr/include/etip.h
/usr/include/form.h
/usr/include/menu.h
....................................................

 

Step 5: Uninstall Ncurses Library

Once you are done with Ncurses Library, you can choose to uninstall it from your system by using sudo apt-get remove libncurses5-dev libncursesw5-dev command as shown below.

NOTE:

Please be careful in running below command as sometimes it might remove some of the dependent packages which are used by other active running applications in the System.
cyberithub@ubuntu:~$ sudo apt-get remove libncurses5-dev libncursesw5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-goa-1.0 libfwupdplugin1 libllvm11 libncurses-dev libxmlb1
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
libncurses5-dev libncursesw5-dev
0 upgraded, 0 newly installed, 2 to remove and 3 not upgraded.
After this operation, 12.3 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 196177 files and directories currently installed.)
Removing libncurses5-dev:amd64 (6.2-0ubuntu2) ...
Removing libncursesw5-dev:amd64 (6.2-0ubuntu2) ...

Leave a Comment