libssl / openssl error though package is installed - linux

Im having the following problem.
Both of my Virtualmachines are showing the same error though libssl-dev and openssl-dev is installed.
Is there another fix for this or do I need to try setting it up again?
gcc: error: /opt/local/include/openssl/sha.h: No such file or directory
gcc: error: /opt/local/include/openssl/e_os2.h: No such file or directory
gcc: error: /opt/local/include/openssl/opensslconf.h: No such file or directory
make: *** [obj/scrypt.o] Error 1

traaitt#ubuntu:~$ cd /opt/
traaitt#ubuntu:/opt$ cd local
traaitt#ubuntu:/opt/local$ sudo mkdir include
traaitt#ubuntu:/opt/local$ cd include
traaitt#ubuntu:/opt/local/include$ sudo mkdir openssl
traaitt#ubuntu:/opt/local/include$ cd openssl
traaitt#ubuntu:/opt/local/include/openssl$
sudo ln -s /path/to/file /path/to/symlink
sudo ln -s /usr/include/openssl/sha.h /opt/local/include/openssl/sha.h
sudo ln -s /usr/include/openssl/e_os2.h /opt/local/include/openssl/e_os2.h
sudo ln -s /usr/include/x86_64-linux-gnu/openssl /opt/local/include/openssl/opensslconf.h

Related

Flutter for fedora 37

I'm trying to install flutter on Fedora 37 with snapd but it's not working. Whenever I try to use the command:
sudo snap install flutter --classic
I get the error:
Classic confinement requires snaps under /snap or symlink from /snap to /var/lib/snapd/snap.
Then I run the command:
sudo ln -s /var/lib/snapd/snap /snap
I get the error:
Failed to create symbolic link "snap/snap": File exists.
How do I fix this or find another way to use flutter on Fedora 37?
[ninal#fedora ~]$ sudo ln -s /var/lib/snapd/snap /snap
ln: failed to create symbolic link '/snap/snap': File exists
[ninal#fedora ~]$ sudo snap install flutter --classic
error: cannot install "flutter": classic confinement requires snaps under /snap
or symlink from /snap to /var/lib/snapd/snap
[ninal#fedora ~]$
Sudo or not, ln -s will always fail if the link file already exists. In order to overwrite there is a --force option you can use overwrite an existing link file.
However, the error message "snap/snap": File exists. indicates that you already have a directory named /snap in which a new snap symlink is attempted to be created.
So ln behaves in two different modes, either the last argument is the name of
the link file or
a directory where the link file is to be created within
$ cd /tmp
$ mkdir -p a/b/c
$ ln -s /tmp/a/b # First time, create "b" symlink in /tmp
$ ln -s /tmp/a/b # Second time, fails since symlink exists
ln: failed to create symbolic link './b': File exists
$ ln -sf /tmp/a/b # Succeds, overwrites existing symlink
$ mkdir c
$ ln -s /tmp/a/b/c c # First time, create "c" symlink inside /tmp/c directory
$ ln -s /tmp/a/b/c c # Second time, fails since symlink exists
ln: failed to create symbolic link 'c/c': File exists
$
For your particular scenario you need to get rid of the existing /snap directory to create the expected symlink.
sudo mv /snap /snap.old
sudo ln -s /var/lib/snapd/snap /snap

error while loading shared libraries: libPocoNet.so.60: cannot open shared object file: No such file or directory

The below command returns
sudo find / -name libPocoNet.so
/home/sandeep/server2/poco/cmake-build/lib/libPocoNet.so
/home/sandeep/server/cmake_build/lib/libPocoNet.so
/home/sandeep/server/poco/cmake_build/lib/libPocoNet.so
/home/sandeep/server/poco/lib/Linux/x86_64/libPocoNet.so
/usr/local/lib/libPocoNet.so
to compile code I am using
g++ poco.cpp -lPocoNet
while execution
I am getting the error
error while loading shared libraries: libPocoNet.so.60: cannot open shared object file: No such file or directory
how I built the source
$ git clone -b master https://github.com/pocoproject/poco.git
$ cd poco
$ mkdir cmake-build
$ cd cmake-build
$ cmake .. && cmake --build .
$ sudo cmake --build . --target install
$ cd ..
$ ./configure
$ make -s -j4
$ cd cmake-build
$ make -s -j4
$ cd ..
$ sudo make install
$ cd cmake-build
$ sudo make install
-----------solved using-------------------
sandeep#sandeep:~$ LD_LIBRARY_PATH=/usr/local/lib
sandeep#sandeep:~$ export LD_LIBRARY_PATH
sandeep#sandeep:~$ g++ poco.cpp -lPocoNet
sandeep#sandeep:~$ ./a.out
I moved all Poco libraries from /usr/local/lib to /usr/lib/, it worked for me.
if all necessary libs added to your CMakeList.txt just run the below line and run a.out app.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Unable to build openssl-1.0.2n on LinuxMint

I am trying to update my OpenVPN and OpenSSL.
While updating openvpn to openvpn-2.4.4, I was required to update my openssl first to the latest openssl-1.0.2n
$ cd~
$ wget https://openvpn.net/index.php/download/openvpn-2.4.4.tar.gz
$ sudo tar -zvxf openvpn--2.4.4.tar.gz
$ cd openvpn-2.4.4
$ sudo ./configure
$ sudo make
$ sudo make install
But when I reach ./configure above, I run into an issue with legacy openssl as I have mentioned earlier (i thought an update would fix that):
checking tap-windows.h presence... no
checking for tap-windows.h... no
checking whether TUNSETPERSIST is declared... yes
checking for setcon in -lselinux... no
checking for pam_start in -lpam... no
checking for PKCS11_HELPER... no
checking for OPENSSL... no
checking for SSL_CTX_new... no
configure: error: openssl check failed
So I tried the following commands to update to the latest openssl :
$ cd /usr/src
$ wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz -O openssl-1.0.2n.tar.gz
$ tar -zxf openssl-1.0.2n.tar.gz
$ cd openssl-1.0.2n
$ ./config
$ sudo make
$ sudo make test
$ sudo make install
$ mv /usr/bin/openssl /root/
$ ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
$ openssl version
When I get to make test, I run into a compilation error. I have copy pasted my terminal output here because that output is HUGE, error is in the bottom : pastebin
Any suggestions how I can move past this issue?
RELEASE=18 sarah, EDITION=Cinnamon 32-bit, GRUB_TITLE=Linux Mint 18 Cinnamon 32-bit
Judging from your output, you need to run all three commands as sudo, and you missed the initial make.
elliot#warmachine /usr/src/openssl-1.0.2n $ sudo ./config
...
elliot#warmachine /usr/src/openssl-1.0.2n $ make
...
/bin/sh: 1: cannot create buildinf.h: Permission denied
Makefile:58: recipe for target 'buildinf.h' failed
which fails as it does not have permissions to write to the directory, which causes sudo make test to fail because openssl hasn't been built:
/usr/bin/ld: cannot find -lssl
collect2: error: ld returned 1 exit status
-l{library_name} is what ld uses to link in external libraries, meaning test cannot find the openssl .so that should have been built in previous steps
Lastly, it is bad practice to build software as root. My recommendation is to build it as an unprivileged user, then install as root.
$ cd ~
$ wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz -O openssl-1.0.2n.tar.gz
$ tar -zxf openssl-1.0.2n.tar.gz
$ cd openssl-1.0.2n
$ ./config
$ make
$ make test
$ sudo make install

Error Loading Shared Library (glew)

I compiled the library GLEW. It seemed to work fine, here is the output of make install:
install -d -m 0755 "/usr/include/GL"
install -m 0644 include/GL/wglew.h "/usr/include/GL/"
install -m 0644 include/GL/glew.h "/usr/include/GL/"
install -m 0644 include/GL/glxew.h "/usr/include/GL/"
sed \
-e "s|#prefix#|/usr|g" \
-e "s|#libdir#|/usr/lib64|g" \
-e "s|#exec_prefix#|/usr/bin|g" \
-e "s|#includedir#|/usr/include/GL|g" \
-e "s|#version#|1.11.0|g" \
-e "s|#cflags#||g" \
-e "s|#libname#|GLEW|g" \
-e "s|#requireslib#|glu|g" \
< glew.pc.in > glew.pc
install -d -m 0755 "/usr/lib64"
install -m 0644 lib/libGLEW.so.1.11.0 "/usr/lib64/"
ln -sf libGLEW.so.1.11.0 "/usr/lib64/libGLEW.so.1.11"
ln -sf libGLEW.so.1.11.0 "/usr/lib64/libGLEW.so"
install -m 0644 lib/libGLEW.a "/usr/lib64/"
install -d -m 0755 "/usr/lib64"
install -d -m 0755 "/usr/lib64/pkgconfig"
install -m 0644 glew.pc "/usr/lib64/pkgconfig/"
Now I wanted to use it on a KDevelop project. I created my CMakeLists.txt and linked the library there using find_package:
cmake_minimum_required( VERSION 2.6 )
project(openglengine)
include_directories(headers)
set(SOURCE_FILES src/main.cpp)
set(CMAKE_CXX_FLAGS "--pedantic-errors -Wall -std=gnu++11")
add_executable(openglengine ${SOURCE_FILES} ${HEADER_FILES})
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
target_link_libraries(openglengine ${GLFW_STATIC_LIBRARIES})
find_package(GLEW)
if (GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIRS})
target_link_libraries (openglengine ${GLEW_LIBRARIES})
endif (GLEW_FOUND)
install(TARGETS openglengine RUNTIME DESTINATION ~/projects/OpenGLEngine/bin)
I get no build errors.
When I try to run the program here is the output:
error while loading shared libraries: libGLEW.so.1.11: cannot open shared object file: No such file or directory
Any help will be appreciated.
EDIT:
Using the command locate libGLEW I get this output:
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10.0
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libGLEW.so.1.6
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libGLEW.so.1.6.0
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.10
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.10.0
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6
/home/lhahn/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6.0
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEW.a
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEW.so
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEW.so.1.11
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEW.so.1.11.0
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEWmx.a
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEWmx.so
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEWmx.so.1.11
/home/lhahn/.local/share/Trash/files/glew/lib/libGLEWmx.so.1.11.0
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEW.a
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEW.so
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEW.so.1.11
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEW.so.1.11.0
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEWmx.a
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEWmx.so
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEWmx.so.1.11
/home/lhahn/Documents/OpenGL-Utils/GLEW/glew-1.11.0/lib/libGLEWmx.so.1.11.0
/usr/lib64/libGLEW.a
/usr/lib64/libGLEW.so
/usr/lib64/libGLEW.so.1.11
/usr/lib64/libGLEW.so.1.11.0
Which show that I have the library. Does that mean that the command find_package may be not working? Which is strange because I get no link errors.
So, I managed to make it work by creating a symbolic link in /usr/lib/ for the library that was in /usr/lib64.
sudo ln -s /usr/lib64/libGLEW.so.1.11 /usr/lib/libGLEW.so.1.11
Now it works fine. Since I am no expert on linux I don't know if that will bring me problems in the future.
I don't know if the answer by #Ihahn will have any issues but, if the some program is not finding your shared libraries, then first find the folder that your library was installed and is not in your shared library folder and then run sudo ldconfig <location_where_your_library_or_program_was_installed>. Sometimes this happens when you're installing/building programs via make install.Reference here..

linuxfromscratch: Can't do make menuconfig for linux installing

On this chapter http://www.linuxfromscratch.org/lfs/view/stable/chapter08/kernel.html
root#host# chroot "$LFS" /usr/bin/env -i \
> HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
> PATH=/bin:/usr/bin:/sbin:/usr/sbin \
> /bin/bash --login
root:/# cd sources/linux-3.2.6
root:/sources/linux-3.2.6# make mrproper
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN include/config
root:/sources/linux-3.2.6# make menuconfig
HOSTCC scripts/basic/fixdep
gcc: error trying to exec 'as': execvp: No such file or directory
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
Why am i gettting such error?
Updating
Got the answer, it is binutils installation related, may be corrupted installation of binutis.
http://www.linuxquestions.org/questions/linux-software-2/gcc-error-trying-to-exec-%27as%27-execvp-no-such-file-or-directory-906750/
`gcc: error trying to exec 'cc1': execvp: No such file or directory` When compile program with `popen` in php
You need to install GNU Binutils package.
http://www.gnu.org/software/binutils/

Resources