How to solve sudoers path problem in yocto - path

On my Yocto image (with .deb packaging) i set up sudo an it work's fine. Only when i try to install a .deb package with:
sudo dpkg -i package-name.deb
It results in:
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
I already did as workaround in /etc/sudoers manually:
## Uncomment to use a hard-coded PATH instead of the user's to find commands
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
And after that sudo dpkg worked
The question now is:
How to do it in yocto build to have this solved out of the box ? How can I change the /etc/sudoers file to have this setup as default in the build? Or are there any other solutions ?
Thank's a lot for any help

Related

Why do I get `fatal error: Eigen/Dense` when compiling Drake, even though `install_prereqs` succeeded?

On Ubuntu, when compiling Drake as an external, I get errors like the following:
$ bazel build #drake//proximity:proximity_utilities
...
ERROR: {bazel_cache}/external/drake/geometry/proximity/BUILD.bazel:557:17: Compiling geometry/proximity/proximity_utilities.cc failed: (Exit 1): gcc-7 failed: error executing command
...
Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/fcl/include/fcl/math/bv/AABB.h:41:0,
...
from external/drake/geometry/proximity/proximity_utilities.cc:1:
external/fcl/include/fcl/common/types.h:46:10: fatal error: Eigen/Dense: No such file or directory
#include <Eigen/Dense>
^~~~~~~~~~~~~
However, I ran install_prereqs per Drake's instructions.
What is the issue?
Most likely, you have a non-system version of Eigen that was installed via something like sudo make install, and its pkg-config file (e.g. /usr/local/share/pkgconfig/eigen.pc) is shadowing the distribution's file (/usr/share/pkgconfig/eigen3.pc).
You can check this by running pkg-config --debug eigen3, and checking for a line Saying Reading 'eigen3' from file '...'.
The simplest solution is to remove the offending pkg-config file(s), clean your bazel build, and rebuild. For example:
# WARNING: This may break / confuse other projects. If you can,
# see if you can uninstall using a more specific command.
# For example, if using CMake, try to install from the
# generated `install_manifest.txt`.
sudo rm /usr/local/share/pkgconfig/eigen3.pc
# Ensure the bazel build is fully cleaned to pick up newer
# file.
$ bazel clean --expunge --async
# Then rebuild.
# One simple target to rebuild and ensure it doesn't fail:
$ bazel build #drake//common:common
While it is sometimes useful to install to /usr/local out of convenience / prototyping, it can be bad because it can shadow / confuse other tools that may look for another version of packages on your system.

install MongoDB C++ Driver problem in ubuntu 16.04

I want to install MongoDB C++ Driver, so first is mongocxx
I follow this installation:
http://mongocxx.org/mongocxx-v3/installation/
but I can not pass step 4
when I run this in mongo-cxx-driver/build
sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
it shows
-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"libmongoc-1.0", but CMake did not find one.
Could not find a package configuration file provided by "libmongoc-1.0"
(requested version 1.13.0) with any of the following names:
[![enter image description here][1]][1]
libmongoc-1.0Config.cmake
libmongoc-1.0-config.cmake
Add the installation prefix of "libmongoc-1.0" to CMAKE_PREFIX_PATH or set
"libmongoc-1.0_DIR" to a directory containing one of the above files. If
"libmongoc-1.0" provides a separate development package or SDK, be sure it
has been installed.
second question,
Step 2: Choose a C++17 polyfill how can I set MNMLSTC/core?
does anyone can help me,I already trap here for a long time ?
my env:
mongo-c-driver 1.15.1
libmongoc-1.0
mongocxx-3.4.x
Cmake is complaining about not finding a package configuration file (xxx.cmake), probably because you didn't build libmongoc/libbson.
I've tried to reproduce your issue and hit the same problem when I only installed them (apt-get install), so my suggestion is that you get the sources and build them as described at: http://mongoc.org/libmongoc/current/installing.html
Here's the list of commands (with the latest version of mongo-c-driver=1.15.1) which I just tried and worked fine:
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.15.1/mongo-c-driver-1.15.1.tar.gz
tar xzf mongo-c-driver-1.15.1.tar.gz
cd mongo-c-driver-1.15.1
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install
At this point you can go back into mongocxx/build and run again the command you were stuck at:
cd ../../mongo-cxx-driver/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..

Package opencv was not found in the pkg-config search path when trying to build docker image

I'm trying to build docker image, but I have this
app/utils
app/vendor/fifo/fifobuffer_v2
parkingDetection/pkgs/utils
app/pkgs/utils
app/vendor/github.com/stratoberry/go-gpsd
parkingDetection/gpsdata
gocv.io/x/gocv app/gpsdata
pkg-config --cflags opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'opencv', required by 'virtual:world', not found
pkg-config:
exit status 1
apt-file search opencv.pc
gives me
libopencv-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc
echo $PKG_CONFIG_PATH
gives me
/usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc
How can I solve this problem?
I had a similar problem when I was trying to install a deep learning framework and this is how I fixed it:
Add the following to your .bashrc file:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig
export PKG_CONFIG_PATH
then run the .bashrc file by either
source ~/.bashrc
or
. ~/.bashrc
I hope it works for you.
So, I guess, I just can't build docker image, which uses ppencv without opencv on my pc

unable to build and install openH264 video codec for ios

I'm trying to install openH264 for ios. Here are the steps I run from the openH264's current directory using terminal:
$ make OS=ios ARCH=armv7
The default location of openh264 installation was set /usr/local in the makefile. So, I just ran the following command
$make install
But I got this error:
nasm -DUNIX64 -DPREFIX -f macho64 -Icodec/common/x86/ -o codec/encoder/core/x86/coeff.o codec/encoder/core/x86/coeff.asm
nasm: fatal: unrecognised output format `macho64' - use -hf for a list
type `nasm -h' for help
make: *** [codec/encoder/core/x86/coeff.o] Error 1
I am following this instructions also to build the codec. Besides after successful installation I have to include it into pjsip for video support.
I don't know what is the problem with the command? Thanks in advance.
With help of this I solved it.
Just run :
$sudo make OS=ios ARCH=arm64 install
for arm64 architecture. Change the ARCH value to armv7, armv7s for devices and i386 and x86_64 for the simulator. By default it installed in /usr/local/lib directory. I used sudo to get admin privilege as at the end of complication it throwing error that permission denied to mkdir -p /usr/local/lib .

Error in pkg-config

I installed Debian OS on Rpi. While installing opencv, I create "opencv.pc" file in "/home/pi/Opencv-2.4.3/release/lib". Then I entered following two commands:
sudo gedit /etc/bash.bashrc
Add the following two lines to the “bash.bashrc” file and save the file:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/pi/Opencv-2.4.3/release/lib/pkgconfig
export PKG_CONFIG_PATH
Then I got following errors after entered these commands:
chmod +x build_all.sh
/build_all.sh
What is the solution?
errors are..
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
contours.c:1:39: fatal error: opencv2/imgproc/imgproc_c.h: No such file or directory
compilation terminated.
compiling convert_cascade.c
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found..etc..
To add the correct path to your bashrc you can do the following steps
sudo find / -name "opencv.pc" -type f
notice the directory output from 1. (without filename)
open /etc/bash.bashrc sudo vi /etc/bash/bash.bashrc
find and edit or add the following lines
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/your/path/from/#1
export PKG_CONFIG_PATH
save your file :wq
logout and login again to active the changes

Resources