idn2.h: No such file or directory - centos

I am on 64-bit Centos 6.6 and want to install libidn2-devel. I tried yum install libidn2-devel and that didn't work. I tried downloading rpms from various websites from Internet(resolving recursive dependencies manually!)
(Not so) Soon I stuck at the one of the dependencies
libidn2.so.0()(64bit) is needed by libidn2-devel-0.10-1.sdl7.x86_64
which I could not find anywhere on the Internet (for CentOS).
Eventually, I downloaded the source and tried to build it.
wget -c ftp://alpha.gnu.org/gnu/libidn/libidn2-0.10.tar.gz
tar -xvzf libidn2-0.10.tar.gz
./configure
make
Success!
However, when I used it to run a module, it gives me
error: idn2.h: No such file or directory
<idn2_variable> was not declared in this scope
PS : RPM seems weird
$ rpm -q libidn2-devel
package libidn2-devel is not installed
$ rpm -q libidn2
libidn2-2.0.4-1.el6.x86_64

libidn2-devel is provided via the EPEL Repo
Name : libidn2-devel
Arch : x86_64
Version : 2.0.4
Release : 1.el6
Size : 54 k
Repo : epel
Summary : Development files for libidn2
URL : https://www.gnu.org/software/libidn/#libidn2
License : (GPLv2+ or LGPLv3+) and GPLv3+
Description : The libidn2-devel package contains libraries and header files for
: developing applications that use libidn2.
The wiki page here will give you some more details, and if you want to install EPEL for use with yum then you should download (and install) this rpm to your system then check in /etc/yum.repos.d/epel.repo for the config file it will leave. Inside there you need to check the [EPEL] section has the line enabled=1 (I think its disabled by default)
You may want/need to clean up the stuff you have tried to manually install though so you avoid any problems with updates etc.

Related

CPP-REST-SDK in Centos 7

I have a CentOS 7 (EPEL-Repo is registered) but I do not find the package for CPP-REST (libcpprest-dev in Debian) in the repos.
Do I need to install it from vanilla or is there a package in CentOS?
Thanks!
Short answer...
There is not an "official" CentOS 7 package at this time (2018-10-03) for cpprestsdk (libcpprest-dev in Debian).
Long answer (sharing this in case it helps anyone)...
You could build cpprestsdk from source, but the instructions "How to build for Linux" (https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Linux) do not include CentOS or RHEL (at the time of this writing, 2018-10-03).
Before building cpprestsdk on CentOS 7, you'll need to update boost (at time of this writing CentOS 7 repos have boost 1.53, but 1.54 is required, and 1.68 is latest). You can do this to update (using boost 1.68 as example):
cd && wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar -xzvf boost_1_68_0.tar.gz
cd ~/boost_1_68_0
./bootstrap.sh --prefix=/opt/boost
sudo ./b2 install --prefix=/opt/boost --with=all
After updating boost, I was able to build cpprestsdk on CentOS 7 like this...
Install some needed tools/libraries:
sudo yum -y install git cmake3 openssl-devel gcc-c++ make
Download the cpprestsdk project:
git clone https://github.com/Microsoft/cpprestsdk.git casablanca
cpprestsdk wants to treat warnings as errors. I had to turn this off by commenting out this line in ~/casablanca/Release/CMakeLists.txt:
#set(WERROR ON CACHE BOOL "Treat Warnings as Errors.")
Prepare/build cpprestsdk project:
cd casablanca/Release
mkdir build.release && cd build.release
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/opt/boost
make
Install header files and library
sudo make install
Notice that I am calling cmake3 (not cmake) and I am specifying the boost root; which differs from the official instructions that appear to be written and tested for Ubuntu (not CentOS or RHEL). To build my projects using cpprestsdk, I had to use ldconfig to find the library paths.

How to install perl(Unix::Syslog) on CentOS using yum?

I'm getting perl(Unix::Syslog) as a dependent package when I installing certain application.
perl(Unix::Syslog) is needed by
I tried installing it as yum install 'perl(Unix::Syslog)' but it give following result.
No package perl(Unix::Syslog) available.
Error: Nothing to do
I tried to install it using RPM but it give lot more dependencies list.
So they best why for this is installing using yum but I cannot find a way to do this.
Edit : Actually I tried yum install perl-Unix-Syslog too but result is the same. May be I don't have the correct repository configured in my CentOS.
So I googled and found below as a fix but it didn't fix the issue.
yum --enablerepo=extras install epel-release
Try; perl-Unix-Syslog
yum info perl-unix-syslog
Available Packages
Name : perl-Unix-Syslog
Arch : x86_64
Version : 1.1
Release : 3.el6
Size : 28 k
Repo : epel
Summary : Perl interface to the UNIX syslog(3) calls
URL : http://search.cpan.org/dist/Unix-Syslog/
License : Artistic 2.0
Description : This module provides an interface to the system logger syslogd(8) via
: Perl's XSUBs. The implementation attempts to resemble the native libc-
: functions of your system, so that anyone being familiar with syslog.h
: should be able to use this module right away.
You can also find it via http://rpm.pbone.net
If you are missing the repo then add this to your /etc/yum/repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
You may also need to do; yum clean all before you retry the install to clear the cache and mirror list.

imagemagick install problems in centos

i'm trying to install imagemagick on my server (centos 7.1 minimal) by this url:
imagemagick installation steps
get this error in step 1:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.de.leaseweb.net
* epel: mirrors.n-ix.net
* extras: mirror.de.leaseweb.net
* remi: remi.schlundtech.de
* remi-php55: remi.schlundtech.de
* remi-php56: remi.schlundtech.de
* remi-safe: remi.schlundtech.de
* remi-test: remi.schlundtech.de
* updates: mirror.de.leaseweb.net
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package php-devel available.
No package php-pear available.
Nothing to do
Because this item has been questioned on many sites, I fully explain the installation process...
this proccess tested on centos 6.5 and php56 and imagick-3.4.3(ImageMagick-7)
Change the installation process for any part that needs to be changed like as your php version or folder.
you can find lasted version of "ImageMagick" in ImageMagick versions
; use lasted stable version.
If you have already installed "ImageMagick" several times, first remove all of them and find "ImageMagick" & "imagick" folders & files and clean all of them and continue the installation process with this process.
# yum remove ImageMagick ImageMagick-devel
Use the following command to find a file or folder:
# find / -name 'ImageMagick*'
# find / -name 'imagick*
Find and delete all the files and folders that are displayed
Start Installation php-pear:
Ensure you have php-pear installed, which will be used later to install Imagick PHP module.
If you don’t have pear, you can install using Yum:
# yum install php-pear
If you see the following error:
No package php—pear available.
Error: Nothing to do
solation:
# cd /etc/
and open yum.conf
OR
# nano /etc/yum.conf
And then find and remove php* and save file
then type:
# yum install --enablerepo remi php-pear php-devel
for test success Installation:
type:
# yum info php-pear
result is something like this :
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* epel: yum.ds.stackexchange.com
stack-local-prod | 2.9 kB 00:00
Available Packages
Name : php-pear
Arch : noarch
Epoch : 1
Version : 1.9.4
Release : 4.el6
Size : 393 k
Repo : base
Summary : PHP Extension and Application Repository framework
URL : http://pear.php.net/package/PEAR
License : BSD and PHP and LGPLv2+
Description : PEAR is a framework and distribution system for reusable PHP
: components. This package contains the basic PEAR components.
Start Installation ImageMagick:
# yum install ImageMagick
# yum install ImageMagick-devel
# pecl install Imagick
Important: copy "ImageMagick" folder from "/usr/include" to "/usr/local/include" for ImageMagick find "MagickWand.h"
# cd /usr/include
# cp ImageMagick /usr/local/include
before below lines don't forget: go to "php.ini" find "disable_functions" and clean "proc_open,popen,proc_close" becuase make imagick needs these functions, after complete installation you can add this functions to your "disable_functions" on "php.ini" file.
continue:
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-3.4.3.tgz
# tar xzfv imagick-3.4.3.tgz
# cd imagick-3.4.3
# phpize
# ./configure --with-php-config=/usr/local/php56/bin/php-config
# make
# make install
copy Installing shared extensions: "/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/" this is extension dir
Copy "imagick.so" from "/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/" to "/usr/local/php56/lib/php/extensions/" extension directory.
# cd /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
# cp imagick.so /usr/local/php56/lib/php/extensions/
Then, edit "php.ini", find "Dynamic Extensions" add extension=imagick.so in a empty line, don't forget there are 2 or more "php.ini" on your server, you can find all of them:
# find / -name 'php.ini'
result may be like this
/etc/php.ini
/usr/local/php56/lib/php.ini
Use this file at all stages:
/usr/local/php56/lib/php.ini
for test success Installation:
# php -m | grep imagick
result should be: imagick
for find all php functions and extensions use :
# php -m
now you can find "imagick" at showed list
Don't forget:
edit "php.ini", find "disable_functions" and add "proc_open,popen,proc_close" to disable_functions For server security!
now reboot your server
# reboot
for test imagick installation on php, use this code at php file:
if(extension_loaded('imagick')) {
$imagick = new Imagick();
print_r($imagick->queryFormats());
}
else {
echo 'imagick is not available.';
}
OR use
echo phpinfo();
According to the repository list in your paste, you are using "remi" repository for PHP. So, just
yum install php-pecl-imagick
No need to build from sources, when a RPM package exists.
But as yum doesn't even found php-devel, check yum configuration for "exclude" line, looks like a cpanel host which replace lot of base packages by their own.

Can't install jdk on Fedora with yum nor with rpm

Help! I can't figure out how to install a jdk!
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.6.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.6.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.6.0-openjdk"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.6.0-openjdk available.
Error: Nothing to do
Here I've manually downloaded some rpm's, the last one from oracle's website:
[~]$ rpm -ivh java-1.7.0-openjdk-devel-1.7.0.19-2.3.9.3.fc20.x86_64.rpm
error: Failed dependencies:
java-1.7.0-openjdk = 1:1.7.0.19-2.3.9.3.fc20 is needed by java-1.7.0-openjdk-devel-1:1.7.0.19-2.3.9.3.fc20.x86_64
[~]$ sudo rpm -ivh java-1.7.0-openjdk-1.7.0.19-2.3.9.3.fc20.x86_64.rpm
Preparing... ################################# [100%]
file /usr/lib/jvm-exports/jre-1.7.0-openjdk.x86_64 from install of java-1.7.0-openjdk-1:1.7.0.19-2.3.9.3.fc20.x86_64 conflicts with file from package java-1.7.0-openjdk-1:1.7.0.9-2.3.7.0.fc18.x86_64
file /usr/lib/jvm/jre-1.7.0-openjdk.x86_64 from install of java-1.7.0-openjdk-1:1.7.0.19-2.3.9.3.fc20.x86_64 conflicts with file from package java-1.7.0-openjdk-1:1.7.0.9-2.3.7.0.fc18.x86_64
[~]$ sudo rpm -ivh jdk-7u21-linux-x64.rpm
Preparing... ################################# [100%]
file /etc/init.d/jexec from install of jdk-2000:1.7.0_21-fcs.x86_64 conflicts with file from package jdk-2000:1.6.0_38-fcs.x86_64
Debug
Here's some debug information:
[/usr/lib/jvm]$ yum search jdk
Loaded plugins: langpacks, presto, refresh-packagekit
=========================================================== N/S Matched: jdk ============================================================
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
jdk.x86_64 : Java(TM) Platform Standard Edition Development Kit
ldapjdk.noarch : The Mozilla LDAP Java SDK
Name and summary matches only, use "search all" for everything.
.
[/usr/lib/jvm]$ yum list java*
Loaded plugins: langpacks, presto, refresh-packagekit
Installed Packages
java-1.5.0-gcj.x86_64
.
[/usr/lib/jvm]$ cat /etc/fedora-release
Fedora release 18 (Spherical Cow)
Requirements
I must have "jni.h", "libjava.so", "libhpi.so", "lipverify.so" and "libjvm.so" included.
So far I've found out that these DO NOT have what I need:
Undesired Versions (for sure):
jdk1.7.0_06 <-- I'm surprised about this one, but it doesn't have libjvm nor libhpi
java-1.7.0
java-openjdk
java-1.7.0-openjdk-1.7.0.9.x86_64
java-1.5.0-gcj-4.4
java-1.6.0-openjdk
java-1.7.0-openjdk.x86_64
jre-1.5.0-gcj
jre-1.7.0-openjdk.x86_64
jre-openjdk
jre-1.7.0
jre-7u11-linux-x64.rpm java-1.5.0-gcj-1.5.0.0
jre-1.5.0
jre1.7.0_11
jre-gcj
And these do:
Desired Versions (that I know of, there could be more):
jdk1.6.0_34-x86
jdk1.5.0_22-x86
java-6-openjdk
Can someone help me install jdk1.6 or java-6-openjdk please?
The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the /etc/init.d/jexec script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting *.bin and using JAVA_HOME if you are going to use the Oracle distribution as it does not have this problem and you will probably not need jexec anyway.
In general I would suggest that you install the Oracle JDK not the OpenJDK. Otherwise you might risk running into some issues. I always found problems of all sorts and sizes with OpenJDK that I don't even bother trying it any more.
Download the JDK RPM from here and follow the usual instructions. Its usually very straightforward and without problems.
Full detailed instructions including how to install it here.
Make sure you choose the right version you need (JDK 1.7 or JDK 1.6, dont mix) because from your question you seem to have a confusion of library versions from 1.5 to 1.7.
And another thing, uninstall whatever you have installed already before installing a fresh one to avoid conflicts.
Check my answer here Transaction check error when installing Sun JDK 7
Basically you may use rpm --force to install one JDK on top of the other. This scenario is completely valid specially when you have to develop for different JAVA versions.
Just faced the same issue. I was not comfortable using --force command; did not want to risk messing-up the existing Java that came installed at system setup.
I ended up doing the following and running the app server with a different version of Java under a different user ID.
downloaded the Java tar.gz version and uncompressed:
tar -zxvf jdk-7u45-linux-x64.gz
Created the directory:
mkdir /usr/java/jdk1.7.0_45
Copied the contents to the new directory manually:
cp -r /.../jdk1.7.0_45/* /usr/java/jdk1.7.0_45
Set the java_home under the user ID home directory in .bashrc and .bash_profile files:
export JAVA_HOME=/usr/java/jdk1.7.0_45
export PATH=$JAVA_HOME/bin:$PATH
export PATH=$PATH:/usr/sfw/lib/gcc:/usr/sfw/bin
sudo rpm -i jdk-11.0.9_linux-x64_bin.rpm
or whatever package you are trying to install

How do I find which rpm package supplies a file I'm looking for?

As an example, I am looking for a mod_files.sh file which presumably would come with the php-devel package. I guessed that yum would install the mod_files.sh file with the php-devel x86_64 5.1.6-23.2.el5_3 package, but the file appears to not to be installed on my filesystem.
How do I find out which package installs a specific file? I'm looking for where I have not necessarily already locally downloaded the package which may include the file that I'm looking for.
I'm using CentOS 5.
This is an old question, but the current answers are incorrect :)
Use yum whatprovides, with the absolute path to the file you want (which may be wildcarded). For example:
yum whatprovides '*bin/grep'
Returns
grep-2.5.1-55.el5.x86_64 : The GNU versions of grep pattern matching utilities.
Repo : base
Matched from:
Filename : /bin/grep
You may prefer the output and speed of the repoquery tool, available in the yum-utils package.
sudo yum install yum-utils
repoquery --whatprovides '*bin/grep'
grep-0:2.5.1-55.el5.x86_64
grep-0:2.5.1-55.el5.x86_64
repoquery can do other queries such as listing package contents, dependencies, reverse-dependencies, etc.
To know the package owning (or providing) an already installed file:
rpm -qf myfilename
The most popular answer is incomplete:
Since this search will generally be performed only for files from installed packages, yum whatprovides is made blisteringly fast by disabling all external repos (the implicit "installed" repo can't be disabled).
yum --disablerepo=* whatprovides <file>
You go to http://www.rpmfind.net and search for the file.
You'll get results for a lot of different distros and versions, but quite likely Fedora and/or CentOS will pop up too and you'll know the package name to install with yum
Well finding the package when you are connected to internet (repository) is easy however when you only have access to RPM packages inside Redhat or Centos DVD (this happens frequently to me when I have to recover a server and I need an application) I recommend using the commands below which is completely independent of internet and repositories. (supposably you have lots of uninstalled packages in a DVD).
Let's say you have mounted Package folder in ~/cent_os_dvd and you are looking for a package that provides "semanage" then you can run:
for file in `find ~/cent_os_dvd/ -iname '*.rpm'`; do rpm -qlp $file |grep '.*bin/semanage'; if [ $? -eq 0 ]; then echo "is in";echo $file ; fi; done
Using only the rpm utility, this should work in any OS that has rpm:
rpm -q --whatprovides [file name]
Ref. https://www.thegeekdiary.com/how-to-find-which-rpm-package-provides-a-specific-file-or-library-in-rhel-centos/
You can do this alike here but with your package. In my case, it was lsb_release
Run: yum whatprovides lsb_release
Response:
redhat-lsb-core-4.1-24.el7.i686 : LSB Core module support
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/bin/lsb_release
redhat-lsb-core-4.1-24.el7.x86_64 : LSB Core module support
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/bin/lsb_release
redhat-lsb-core-4.1-27.el7.i686 : LSB Core module support
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/bin/lsb_release
redhat-lsb-core-4.1-27.el7.x86_64 : LSB Core module support
Repo : rhel-7-server-rpms
Matched from:
Filename : /usr/bin/lsb_release`
Run to install: yum install redhat-lsb-core
The package name SHOULD be without number and system type so yum packager can choose what is best for him.