Missing ncurses header file - ncurses

I am using fedora16 in vmware but there is no ncurses header file. so i cannot practice with ncurses, how can I install ncurses header file.

Fedora 16 is rather old, but if you can get to a workable yum server, you can install the ncurses-devel package to get the header files.

Since you use fedora then doing the following installs ncurses on fedora:
First, go to rpmfind.net then search for ncurses and download the package according to your architecture. Then do the following to install the package:
rpm -i </Path/Package_name.extension>
Or alternatively, you can download the source code and compile it yourself by:
tar zxvf Ncurses_packageName.tar.gz
cd Ncurses_packageName
./configure
make
sudo make install

Related

How to compile a C file with an OpenSSL dependency? [duplicate]

I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0. When I run make, it invokes g++ with the "-lssl" option. The source includes:
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/des.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
I ran:
$ sudo apt-get install openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
But I guess the openssl package doesn't include the library. I get these errors on make:
foo.cpp:21:25: error: openssl/bio.h: No such file or directory
foo.cpp:22:28: error: openssl/buffer.h: No such file or directory
foo.cpp:23:25: error: openssl/des.h: No such file or directory
foo.cpp:24:25: error: openssl/evp.h: No such file or directory
foo.cpp:25:25: error: openssl/pem.h: No such file or directory
foo.cpp:26:25: error: openssl/rsa.h: No such file or directory
How do I install the OpenSSL C++ library on Ubuntu 10.04 LTS?
I did a man g++ and (under "Options for Linking") for the -l option it states: " The linker searches a standard list of directories for the library..." and "The directories searched include several standard system directories..." What are those standard system directories?
You want to install the development package, which is libssl-dev:
sudo apt-get install libssl-dev
Run:
apt-get install libssl-dev
All of these answers are very outdated and from when the package was still being developed. You can now just use the "normal" command listed below:
sudo apt install openssl
Edit: OP's question is poorly worded... after all, OpenSSL is a library itself, so I read his question too quickly before answering. The command above installs "normal" OpenSSL.
Toward the bottom of his question he mentions that make fails, suggesting he is compiling the package manually. And yes, even if you download the TAR ball, it will include all of the openssl and libssl files, which you can then make from.
What OP is really asking for is the OpenSSL Development Library, in which case you can first install OpenSSL using the above command, and then run this afterwards:
sudo apt install libssl-dev
More info: https://linuxtect.com/how-to-install-openssl-libraries-on-ubuntu-debian-mint/
I found a detailed solution here: Install OpenSSL Manually On Linux
From the blog post...:
Steps to download, compile, and install are as follows (I'm installing version 1.0.1g below; please replace "1.0.1g" with your version number):
Step – 1 : Downloading OpenSSL:
Run the command as below :
$ wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
Also, download the MD5 hash to verify the integrity of the downloaded file for just varifacation purpose. In the same folder where you have downloaded the OpenSSL file from the website :
$ wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz.md5
$ md5sum openssl-1.0.1g.tar.gz
$ cat openssl-1.0.1g.tar.gz.md5
Step – 2 : Extract files from the downloaded package:
$ tar -xvzf openssl-1.0.1g.tar.gz
Now, enter the directory where the package is extracted like here is openssl-1.0.1g
$ cd openssl-1.0.1g
Step – 3 : Configuration OpenSSL
Run below command with optional condition to set prefix and directory where you want to copy files and folder.
$ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
You can replace “/usr/local/openssl” with the directory path where you want to copy the files and folders. But make sure while doing this steps check for any error message on terminal.
Step – 4 : Compiling OpenSSL
To compile openssl you will need to run 2 command : make, make install as below :
$ make
Note: check for any error message for verification purpose.
Step -5 : Installing OpenSSL:
$ sudo make install
Or without sudo,
$ make install
That’s it. OpenSSL has been successfully installed. You can run the version command to see if it worked or not as below :
$ /usr/local/openssl/bin/openssl version
OpenSSL 1.0.1g 7 Apr 2014
How could I have figured that out for
myself (other than asking this
question here)? Can I somehow tell
apt-get to list all packages, and grep
for ssl? Or do I need to know the
"lib*-dev" naming convention?
If you're linking with -lfoo then the library is likely libfoo.so. The library itself is probably part of the libfoo package, and the headers are in the libfoo-dev package as you've discovered.
Some people use the GUI "synaptic" app (sudo synaptic) to (locate and) install packages, but I prefer to use the command line. One thing that makes it easier to find the right package from the command line is the fact that apt-get supports bash completion.
Try typing sudo apt-get install libssl and then hit tab to see a list of matching package names (which can help when you need to select the correct version of a package that has multiple versions or other variations available).
Bash completion is actually very useful... for example, you can also get a list of commands that apt-get supports by typing sudo apt-get and then hitting tab.
Another way to install openssl library from source code on Ubuntu, follows steps below, here WORKDIR is your working directory:
sudo apt-get install pkg-config
cd WORKDIR
git clone https://github.com/openssl/openssl.git
cd openssl
./config
make
sudo make install
# Open file /etc/ld.so.conf, add a new line: "/usr/local/lib" at EOF
sudo ldconfig
You want the openssl-devel package.
At least I think it's -devel on Ubuntu. Might be -dev. It's one of the two.
As a general rule, when on Debian or Ubuntu and you're missing a development file (or any other file for that matter), use apt-file to figure out which package provides that file:
~ apt-file search openssl/bio.h
android-libboringssl-dev: /usr/include/android/openssl/bio.h
libssl-dev: /usr/include/openssl/bio.h
libwolfssl-dev: /usr/include/cyassl/openssl/bio.h
libwolfssl-dev: /usr/include/wolfssl/openssl/bio.h
A quick glance at each of the packages that are returned by the command, using apt show will tell you which among the packages is the one you're looking for:
~ apt show libssl-dev
Package: libssl-dev
Version: 1.1.1d-2
Priority: optional
Section: libdevel
Source: openssl
Maintainer: Debian OpenSSL Team <pkg-openssl-devel#lists.alioth.debian.org>
Installed-Size: 8,095 kB
Depends: libssl1.1 (= 1.1.1d-2)
Suggests: libssl-doc
Conflicts: libssl1.0-dev
Homepage: https://www.openssl.org/
Tag: devel::lang:c, devel::library, implemented-in::TODO, implemented-in::c,
protocol::ssl, role::devel-lib, security::cryptography
Download-Size: 1,797 kB
APT-Sources: http://ftp.fr.debian.org/debian unstable/main amd64 Packages
Description: Secure Sockets Layer toolkit - development files
This package is part of the OpenSSL project's implementation of the SSL
and TLS cryptographic protocols for secure communication over the
Internet.
.
It contains development libraries, header files, and manpages for libssl
and libcrypto.
N: There is 1 additional record. Please use the '-a' switch to see it
Go to the official website and download the source code for the version you need
Then unzip the update package and execute the following command
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl -Wl,-rpath,/usr/local/ssl/lib shared
Because the default is to generate only static libraries, if you want dynamic libraries, add the "shared" option
make && make install
sudo apt-get install libcurl4-openssl-dev

libmnl Issue while installing libnetfilter queue in linux

I am trying to install libnetfilter_queue on Suse Linux. But after the
./configure step it shows
error: Package requirements (libmnl >= 1.0.3) were not met
No package 'libmnl' found
I am new to Linux and all the solutions which are available on the web, I don't know how to use them.
How can I fix this problem?
It is a common problem to the people working in computer networking in linux environments.
Go to the below link and download the latest libmnl file.
http://www.netfilter.org/projects/libmnl/downloads.html#libmnl-1.0.3
Unzip it using the below command
tar -xvf libmnl-1.0.3.tar.bz2
cd to the extracted folder
cd libmnl-1.0.3/
Install libmnl
./configure
make
sudo make install
Then you can install the libnetfilter_queue library.

error in Install previous versions of R on ubuntu

I have R 3.4.1.1 on my computer (Linux).
I want to install R version 2.14.1 since the package Rmosek does not work in newer version.
I have downloaded the R-2.14.2.tar.gz from Cran.
My problem is that I do not understand the INSTALL instructions,
It says to unpack the R sources and go to the top directory and issue the following commands:
./configure
make
I wrote the following in a terminal:
tar -zxvf R-2.14.2.tar.gz
cd Downloads
cd R-2.14.2
./configure
It is run but finally gives the error:
configure: error: --with-x=yes (default) and X11 headers/libs are not available
make
and it gives the error:
make: *** No targets specified and no makefile found. Stop.
The file explains that If my make is not called `make', set the environment variable MAKE to
its name, and use that name throughout these instructions. I really do not know how I should do it since I am new in Linux.
Is there any other instruction with more explanation? I would be very thankful in advance for your help or guidances.
Regards,
Shima.
This is answered in detail in the R installation and administration guide,
http://cran.r-project.org/doc/manuals/R-admin.html#Essential-programs-and-libraries
Unless you do not want to view graphs on-screen (or use a Mac) you
need ‘X11’ installed, including its headers and client libraries. For
recent Fedora distributions it means (at least) RPMs ‘libX11’,
‘libX11-devel’, ‘libXt’ and ‘libXt-devel’. On Debian we recommend the
meta-package ‘xorg-dev’. If you really do not want these you will need
to explicitly configure R without X11, using --with-x=no.
More specifically, for Ubuntu, this means:
sudo apt-get install xorg-dev
and then proceed with compiling and installing R.
If you have to compile R in your system and install you should have libx11-dev package installed in Ubunut.Can you check whether this package is installed or not.
Otherwise you can configure the source with this option as a work around solution only in the case if you are not going to use any GUI functionality in R.
./configure --with-x=no
You need to install these libraries:
sudo apt-get install -y libx11-dev \
xorg-dev \
libcurl4-openssl-dev
Then run:
./configure
make
And then it should work.
Good luck!

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

I am trying to install roccc 2.0. I have installed required packages. Now while installing it, it is giving me this error:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
I searched for gnu/stubs-32.h and came to know, for Linux 64-bit its in glibc-devel and for Linux 32-bit, its in libc6-dev-i386.
I am using Linux 32-bit: i386 GNU/Linux, but couldn't get the lib required to resolve this error.
Can somebody please help me out?
If your Linux distro is Redhat based (Fedora/CentOS/RHEL):
yum install glibc-devel.i686
References
Original post answer solved this problem RHEL x64
Header file gnu/stubs-32.h is under /usr/include/i386-linux-gnu/ but the install script tries to find it in /usr/include/, try this quick fix to complete the installation:
sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu/stubs-32.h
After installation is finished, you can delete the link.
The package name keeps on changing, just do a
yum list glibc-devel
to find out current package for 32 bit. In my case it only listed 2 packages one for 32 bit and one for 64 bit. I just installed the 32 bit using
yum install glibc-devel.i686
Install 'glibc-devel' package, or whatever it called in your distro. You may also need to install ia32-libs lib32z1-dev lib32bz2-dev (names could be different in your distro).
The script is trying to get stubs-32.h from /usr/include/ where it is not found. To solve this you have to add an "include" path (by default it is /usr/include) like this:
C_INCLUDE_PATH=/usr/include/i386-linux-gnu/
export C_INCLUDE_PATH
OR
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
You can visit Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code for additional reference.
If on a Red Hat distro such as Fedora/CentOS/RHEL you can do the following to find out what package provides a given file:
$ repoquery -qf */stubs-32.h
glibc-devel-0:2.17-260.el7.i686
And then install it:
$ sudo yum install -y glibc-devel-0:2.17-260.el7.i686

Boost Installation

I have a question regarding the installation of the boost libraries. Is there a package that I can use the sudo apt-get install to install this package. I searched all of the questions in this forum and using the commands sudo apt-get install libboost1.40-dev I cannot install theh package with this. Also, I can download it from boost.org but I do not know the correct path to install it too. I would prefer to install it using the sudo apt-get install commands if possible. I am using Ubuntu 9.04.
Thanks.
If you want to run with the latest version, you can do the bjam install as mentioned by Ralf, but I suggest you build a 'pseudo' package so you can
uninstall it safely
prevent/notice conflicts with official/existing boost packages.
Here is how to do that:
mkdir -pv /tmp/boostinst
cd /tmp/boostinst/
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.bz2/download'
tar xf download
cd boost_1_66_0/
./bootstrap.sh --help
./bootstrap.sh --show-libraries
./bootstrap.sh
checkinstall ./b2 install
On new boost version there is other way:
sudo apt-get update
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.50.0/boost_1_50_0.tar.bz2/download'
tar xf download
cd boost_1_50_0
./bootstrap.sh
./b2 install
You can use command aptitude search libboost to see list of the availiable boost libraries. The last version of boost is 1.42 - maybe that's why you can't find version 1.40.
If aptitude search command don't give you sufficient results, try sudo aptitude update and then run aptitude search again.
On my version of Ubuntu (10.04) it's libboost1.40-all-dev
On your version you've probably got an older version of boost, you should just be able to tab-complete to see which version you can install.
In any case what I usually do under Ubuntu is
sudo apt-get install bjam
Extract the downloaded boost archive to your hard-drive and then cd into the root and
sudo bjam install
This way you can get the newest version of boost, and not the slightly outdated one that is available for your Ubuntu version.
This is a link which explain step by step on how to install it (give it some time read!)
http://www.boost.org/doc/libs/1_41_0/more/getting_started/unix-variants.html
but your inline shell command might be the simple and easy way for doing it

Resources