How to find the equivalent way in nix to install a package - nix

I've to install the package build-essential. (because of this error using cargo :
cargo build ->linker cc not found
)
sudo apt install build-essential
I've search in the list of package of nix but I've find it.
How can I install build-essential with nix

The gcc package in nixpkgs provides cc so the solution was to make sure gcc is installed in your environment or shell.

Related

Kong-OIDC Plugin Installation Issue

I am installing Kong-OIDC plugin in a Kong docker container and get following error:
Error: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.6.0-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-jwt-0.2.2-0.src.rock - Rockspec format 3.0 is not supported, please upgrade LuaRocks.
Seems like one of the underlying dependency "lua-jesty-jwt" is using Rockpsec format 3.0 version, which is not supported any more. Is there a way to get around this issue ?
I updated the Dockerfile with a previous version of the kong-oidc plugin. The Dockerfile looks like this:
FROM kong:0.14-centos
LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"
RUN yum install -y git unzip && yum clean all
RUN luarocks install kong-oidc 1.0.1
But running docker build -t kong:0.14-centos-oidc returns this error:
Error: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install luacrypto OPENSSL_DIR=/usr/local
So we need to add RUN yum install openssl-devel -y to the Dockerfile. So, if you run again the docker build command, you'll get this error:
Build error: Failed compiling object src/lcrypto.oError: Failed installing dependency: https://luarocks.org/lua-resty-openidc-1.2.3-1.src.rock - Failed installing dependency: https://luarocks.org/lua-resty-hmac-v1.0-1.rockspec - Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o
So we need to install the gcc compiler adding RUN yum install -y gcc to the Dockerfile. The final result is:
FROM kong:0.14-centos
LABEL description="Centos 7 + Kong 0.14 + kong-oidc plugin"
RUN yum install -y git unzip && yum clean all
RUN yum install -y openssl-devel -y
RUN yum install -y gcc
RUN luarocks install kong-oidc 1.0.1
Now the container builds successfully, but I think the current kong-oidc plugin is not maintained anymore.
UPDATE: Check this repository to get a working example of the kong-oidc plugin with Keycloak.
The latest version of kong-oidc (1.1.0) did not work for me, but I was able to install an older version (1.0.1) without much issue. I did have to install an additional library "openssl-devel" (yum install openssl-devel).

OpenCV error zlib.h: no such file or directory

I am trying to follow this website to install opencv4 on Ubuntu 18.04.
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
But I get this error after make
In file included from /home/gosztolai/opencv/3rdparty/libpng/pngpriv.h:913:0,
from /home/gosztolai/opencv/3rdparty/libpng/png.c:14:
/home/gosztolai/opencv/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
I tried sudo apt install zlib1g-dev but the system says that it is already isntalled
Could someone help what is going on?
libpng uses the zlib library for image compression. To install it in Ubuntu, run the following code in your bash terminal:
sudo apt-get install zlib1g-dev
But because you already have it installed, and need a newer version, you need to update the library. Try to upgrade your packages, using this code:
sudo apt update
sudo apt upgrade -y
Or you can try to remove it using apt and install again.

Problems installing scikit-image in ubuntu 14.04

When I try to install scikit-image with pip2 there is show error. I have tried to find this problem solution.
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/scikit-image
Storing debug log for failure in /home/nshakib/.pip/pip.log
My guess is that you might have missing dependencies. I don't think Ubuntu 14.04 comes out of the box with any of the SciPy stack.
To answer your question try,
sudo apt-get install python-matplotlib python-numpy python-pil python-scipy
Then
sudo apt-get install build-essential cython
Finally
sudo apt-get install python-skimage
If that still doesn't work, you could try using the Anaconda Distribution for Python 2.7 from Continuum Analytics.
It comes with many of the major packages built-in and has a great package manager that manages dependencies.
https://docs.continuum.io/anaconda/install#anaconda-install
The conda package would be installed with conda install scikit-image

Cant install ruby-switch for ruby on rails

I am trying to install ruby on rails on Ubuntu via bright box. I've installed:
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby ruby-dev
But when I try to install this:
sudo apt-get install ruby-switch
I get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ruby-switch is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'ruby-switch' has no installation candidate
What is the problem, and how to solve it?
It doesn't look like ruby-switch is available anymore. That's what apt-get is informing you of.
If you're looking for a way to manage the versions of Ruby, then there is rbenv or RVM available instead. These two approaches are more standard and widely accepted as good ways to switch between Ruby version - but pick only one.

How to install erlang?

i'm planing to install sensu monitoring framework. It needs Erlang to work. I'm running RHEL5 and it's not connected to internet. Only option is to download and install the packages. Please help..
I would try to download and install the RPM package esl-erlang from Erlang Solutions (CentOS tab). It's a single-package installation.
Install required dependencies:
yum install -y openssl openssl-devel ncurses-devel ncurses unixODBC unixODBC-devel make which java-1.8.0-openjdk-devel.ppc64le tar gcc build-essential wget
Download erlang to install erl and escript binaries:
wget erlang.org/download/otp_src_18.3.tar.gz && tar zxvf otp_src_18.3.tar.gz && cd otp_src_18.3 && export ERL_TOP=`pwd` && export PATH=$PATH:$ERL_TOP/bin
Configure and build erlang:
./configure && make && make install
You can download the erlang source tar.gz from internet, then compile the source files and install. just like make and make install.
You can read this link:http://www.erlang.org/doc/installation_guide/INSTALL.html

Resources