Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to install GnuGP2 from sources on CentOS 7 using a custom folder. I am running into problem because either 'configure' or a compiler cannot see libraries / include files even though I set variables for that. I found a script in `github` which downloads and installs everything in to `/usr/local/bin`. I try to install gnugp2 in my custom folder. However, somewhere in the middle I've got error and don't know how to proceed.
Here is the script I am trying to run. Please notice that I have set environmental variables which configure and linker supposed to see. Also, there is a line "echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf" commented as I haven't figure out how to do this.
Thanks
Code:
#!/bin/bash -e
CD=$(pwd)
FOLDER=/opt/applications/gpg-install
APPFOLDER=/opt/applications/gnupg2
mkdir --parents $FOLDER
cd $FOLDER
wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.21.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.7.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.1.1.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.0.0.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.9.0.tar.bz2
tar -xjf libgpg-error-1.27.tar.bz2
tar -xjf libgcrypt-1.7.7.tar.bz2
tar -xjf libassuan-2.4.3.tar.bz2
tar -xjf libksba-1.3.5.tar.bz2
tar -xjf npth-1.5.tar.bz2
tar -xjf ntbtls-0.1.1.tar.bz2
tar -zxf ncurses-6.0.tar.gz
tar -xjf pinentry-1.0.0.tar.bz2
tar -xjf gpgme-1.9.0.tar.bz2
tar -xjf gnupg-2.1.21.tar.bz2
rm libgpg-error-1.27.tar.bz2
rm libgcrypt-1.7.7.tar.bz2
rm libassuan-2.4.3.tar.bz2
rm libksba-1.3.5.tar.bz2
rm npth-1.5.tar.bz2
rm ntbtls-0.1.1.tar.bz2
rm ncurses-6.0.tar.gz
rm pinentry-1.0.0.tar.bz2
rm gpgme-1.9.0.tar.bz2
rm gnupg-2.1.21.tar.bz2
PATH=$APPFOLDER/libgpg-error-1.27/bin:$APPFOLDER/libgcrypt-1.7.7/bin:$APPFOLDER/libksba-1.3.5/bin:$PATH
CPPFLAGS=-I$APPFOLDER/libgpg-error-1.27/include:$APPFOLDER/libgcrypt-1.7.7/include:$APPFOLDER/libksba-1.3.5/include
LDFLAGS=-L$APPFOLDER/libgpg-error-1.27/lib:$APPFOLDER/libgcrypt-1.7.7/lib:$APPFOLDER/libksba-1.3.5/lib
cd libgpg-error-1.27
./configure --prefix=$APPFOLDER/libgpg-error-1.27
make
make install
cd ../
cd libgcrypt-1.7.7
./configure --prefix=$APPFOLDER/libgcrypt-1.7.7
make
make install
cd ../
cd libassuan-2.4.3
./configure --prefix=$APPFOLDER/libassuan-2.4.3
make
make install
cd ../
cd libksba-1.3.5
./configure --prefix=$APPFOLDER2/libksba-1.3.5
make
make install
cd ../
cd npth-1.5
./configure --prefix=$APPFOLDER/npth-1.5
make
make install
cd ../
cd ntbtls-0.1.1
./configure --prefix=$APPFOLDER/ntbtls-0.1.1gnupg-2.1.21
make
make install
cd ../
cd ncurses-6.0
./configure --prefix=/opt/applications/gnupg2/ncurses-6.0
make
make install
cd ../
cd pinentry-1.0.0
./configure --prefix=--prefix=$APPFOLDER/pinentry-1.0.0 --enable-pinentry-curses --disable-pinentry-qt4
make
make install
cd ../
cd gpgme-1.9.0
./configure --prefix=$APPFOLDER/gpgme-1.9.0
make
make install
cd ../
cd gnupg-2.1.21
./configure --prefix=$APPFOLDER/gnupg-2.1.21
make
make install
cd ../
#echo "/usr/local/lib" > /etc/ld.so.conf.d/gpg2.conf
#ldconfig -v
cd $CD
# Without the line below, gpg2 might fail to create / import secret keys !!!
if [ -d ~/.gnugp ]
then
rm -ri ~/.gnugp
fi
gpgconf --kill gpg-agent
echo "Complete !!!"
The message is clearly saying it can't find the header file gcrypt.h.
Is that file found in any of the tar bundles you extracted in either /opt/applications/gpg-install or /opt/applications/gnupg2? (You can run "find <directory> -name gcrypt.h" to see. If not you may need another bundle that includes that file.
I'm curious why you're building your own given gnupgp2 is included with RHEL7 so should already be in CentOS7? The gcrypt.h is part of the libgcrypt-devel package on RHEL7 (and presumably CentOS7).
Last edited by MensaWater; 06-27-2017 at 04:09 PM.
I changed the script slightly. Now everything is loaded to one folder "/opt/applications/gnupg2", which contains: lib, include, bin, and share. In ".bashrc", I set CPPFLAGS and LDFLAGS that point out to folders in "/opt/applications/gnupg2". It gets further now but still complains about missing libraries. Now pinentry complains about missing <curses.h> as a part of "ncurses"; "ncurses" installs libraries into its own subfolder: '/opt/applications/gnupg2/lib/ncurses/'--strange. I added an extra folder to CPPFLAGS to include ncurses:
but "pinentry" still cannot find the <curses.h> :/
"find . -name curses.h -type f" finds the missing file in proper folder: "/opt/applications/gnupg2/include/ncurses/curses.h"
I must say I am out of options now!
To answer your question, I could use gpg 2.0 which is installed in CentOS by default but I read that due to new version gpg 2.1.x version 2.0 will be discontinued. There is something about how keys are stored and they changed it in gpg 2.1.x. I had to do the same with git. The newest version is 2.13.2 whereas v1.8 is the max version available in CentOS 7!
The script
Code:
#!/bin/bash -e
CD=$(pwd)
FOLDER=/opt/applications/gpg-install
APPFOLDER=/opt/applications/gnupg2
mkdir --parents $FOLDER
cd $FOLDER
wget -c https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.21.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.7.7.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.4.3.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.3.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/npth/npth-1.5.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.1.1.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
wget -c https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.0.0.tar.bz2
wget -c https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.9.0.tar.bz2
tar -xjf libgpg-error-1.27.tar.bz2
tar -xjf libgcrypt-1.7.7.tar.bz2
tar -xjf libassuan-2.4.3.tar.bz2
tar -xjf libksba-1.3.5.tar.bz2
tar -xjf npth-1.5.tar.bz2
tar -xjf ntbtls-0.1.1.tar.bz2
tar -zxf ncurses-6.0.tar.gz
tar -xjf pinentry-1.0.0.tar.bz2
tar -xjf gpgme-1.9.0.tar.bz2
tar -xjf gnupg-2.1.21.tar.bz2
rm libgpg-error-1.27.tar.bz2
rm libgcrypt-1.7.7.tar.bz2
rm libassuan-2.4.3.tar.bz2
rm libksba-1.3.5.tar.bz2
rm npth-1.5.tar.bz2
rm ntbtls-0.1.1.tar.bz2
rm ncurses-6.0.tar.gz
rm pinentry-1.0.0.tar.bz2
rm gpgme-1.9.0.tar.bz2
rm gnupg-2.1.21.tar.bz2
cd libgpg-error-1.27
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd libgcrypt-1.7.7
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd libassuan-2.4.3
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd libksba-1.3.5
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd npth-1.5
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd ntbtls-0.1.1
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd ncurses-6.0
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd pinentry-1.0.0
./configure --prefix=$APPFOLDER --enable-pinentry-curses --disable-pinentry-qt4
make
make install
cd ../
cd gpgme-1.9.0
./configure --prefix=$APPFOLDER
make
make install
cd ../
cd gnupg-2.1.21
./configure --prefix=$APPFOLDER
make
make install
cd ../
echo "$APPFOLDER/lib" > /etc/ld.so.conf.d/gpg2.conf
ldconfig -v
cd $CD
# Without the line below, gpg2 might fail to create / import secret keys !!!
if [ -d ~/.gnugp ]
then
rm -ri ~/.gnugp
fi
gpgconf --kill gpg-agent
echo "Complete !!!"
Your reasoning for moving to 2.1 misses the driving setup of RHEL/CentOS. Although they DO start with a certain upstream version they back port bug and security fixes and often enough enhancements into the version they create so it is NOT exactly the same as the original upstream version. You have to look for the extended versioning they put on it.
Also with RHEL7 they are sometimes actually replacing older upstream based packages with newer upstream based packages if the older one is no longer supported.
Your reasoning for moving to 2.1 misses the driving setup of RHEL/CentOS. Although they DO start with a certain upstream version they back port bug and security fixes and often enough enhancements into the version they create so it is NOT exactly the same as the original upstream version. You have to look for the extended versioning they put on it.
Also with RHEL7 they are sometimes actually replacing older upstream based packages with newer upstream based packages if the older one is no longer supported.
Well, I can only say that the point is taken.
Regarding my issue with a missing file, would you have any suggestion why I cannot proceed to compile next library after ncurses is built? I cannot figure out the reason why make cannot find <curses.h> while it passed configure.
Thanks. This worked. The only comment on that is I had to put it between quotation marks. Otherwise, it complained that the folder ncurses was not available.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.